Laravel 5 Unit testing tutorial - database record testing | match record

preview_player
Показать описание
In this video we will learn how to test database record with a simple example
how to start with laravel unit test cases

Checkout and subscribe our new channel for technical news
Рекомендации по теме
Комментарии
Автор

Checkout and subscribe our new channel for technical news

codestepbystep
Автор

By switching Tests/TestCase from PHPUnit\Framework\TestCase and using RefreshDatabase, you are not writing unit tests. Unit tests should not touch the database, that is why RefreshDatabase is not available when running Unit tests. You're just "hacking" them to be Feature tests in the Unit folder, which is what is happening in these videos. Unit tests should generally align to method testing and be very narrow tests, like for calculations and such. Feature tests are wide tests that can be written by devs OR QA engineers that check API endpoints, data creation and such. At least this has been my understanding of the concept of unit testing.

fylzero
Автор

My question is from anyone who is seeing my comment, i do understand how to do unit testing with the help of these videos, but what i am trying to know that why we do php unit testing what is the purpose of unit testing?

PlaydoughASMR
Автор

very very nice
please record more advanced video

mahdimehrabi
Автор

how can i test a query with parameters? for example a where('id', Auth->id)? I bring a total query to my class test? In this case, is about coverage.

Tocherman
Автор

I am getting this error SQLSTATE[HY000]: General error: 1 no such table: users . please help me how can i solve it.

nehamishra
Автор

I am getting this error
Call to undefined method
please help :(

youssefbaddou
join shbcf.ru