Laravel Checklister. Part 20/29: PHPUnit Tests - Setup and First Few Tests

preview_player
Показать описание
Let's hold off creating new features, and test the existing ones instead. In this video, setting up automated tests and creating a test that admin can manage checklist groups.

- - - - -
Support the channel by checking out our products:
Рекомендации по теме
Комментарии
Автор

The test is very complicated and not readable. I'd separate that test to many separated tests, so when the problem appears, I'd exactly know which test failed. Also it's important to name tests properly, so when you run a 'php artisan test' with a bunch of tests, you understand what failed before even looking at those tests.

poplach
Автор

Thank you as always. Keep working! Don't stop now!

belce
Автор

Amazing content! Thanks a lot from Brazil!

mbissonho
Автор

I'm happy to be the first commenting/liking your video today! You've been a great helper for improving my own project and it's already saving a lot of memory/mysql querys and code is way more readable. Have a nice day Mr. Povilas, and thank you for all of your hard work!

valascusbracarensis
Автор

I prefer using route() instead of hardcoded uri.

natanaelaitonean
Автор

I'd definitely use the same database software for the sake of consistency, as soon as you change anything, even patch version, things can sometimes change and that can lead to a lot of head scratching. Of course in the perfect world you rely on ORM that translates your code into equivalent queries for different databases and you don't have to rely on anything implementation specific. But perfect world doesn't exist and you may not realize some edge case makes test pass on test environment but fail on production. Of course in many cases you can safely use sqlite for tests but I'm not a fan of exceptions and losely defined rules. I don't want to waste time analyzing project to decide if I can or not, setting up test database takes less time than that

ZKIUS
Автор

Amazing content as always, thanks a lot

mohamednabih
Автор

Very nice and useful video. Thx. I also published a PHPUnit tutorial here and start a series about it.

NeverCodeAlone
Автор

Hello
Is there a method that crypted Source code laravel (php) for protecting in order to déploye the project in Many customers localy?

MyHaloum
Автор

How do you test your test code is valid and account for any false positives? PHPUnit testing seems over-engineered, recursive, and unnecessary.

HoratioKJV
Автор

I wonder how to cover "everything" in tests. I mean like creating group in this video - it works but imagine you change something and it will fail when you use certain character in group name (e.g " or &). There can be a lot that small things that can fail so what we should do with that?

rafamorawiec
Автор

Ctrl+w or CMD+w select scope m8. Easier than to scroll to select scope.

prozacsf
Автор

Hi @Laravel Daily,

I have question about using hardcoded URL paths, it's a good practice? Or better it's to use for example ? I saw that style on another video about tests for Laravel.

stefik
Автор

Hello dear author can you show how to add Math Latex Formula integration in basic laravel project my like ck editor or smth else thx?

UIRETU
Автор

Thanks. Very usefull. Actually I should do test of Paypal payment. From users point of view. What you would suggest for that? Thx.

GergelyCsermely
Автор

Windows 10, XAMPP,

When I try to use 'sqlite', ':memory:', with just uncomment the params in phpunit.xml (exactly how you do it in the video) and I run 'php artisan test' I get the next error:

The following exception occurred during the request:

PDOException: SQLSTATE[HY000]: General error: 1 no such table: movies in
Stack trace:
#0 PDO->prepare('select * from "...')

belce
Автор

It looks like our project has already taken twice as long, or even more of the estimated time for which you agreed with the client. how to deal with such situations?

L-A-O-S
Автор

Hello sir, how are you doing, I have one question to ask about livewire, can we use livewire with API just like how we use vue js to call our API endpoint? thank you so much will love to see your feedback.

breakingnewstv