The information was useful. I'm working on a personal project, and I'd like to practice by creating tests for controllers. However, I've been struggling because my table has dependencies on other tables. Now, I understand that breaking down my test code into smaller pieces could make it more manageable.
That’s type hinting. I have mentioned the return type of the function. It’s not mandatory, but if you add then it helps a lot with ide. It’s a php 8 thing
I am planning to cover testing external API testing. However, I don't think I will cover everything. Also, is Stripe account free? Is yes, then I will give it a shot.
Thank you very much for the content, I have a question. In the video migration the foreign key should not be accompanied by a constrained method? or it is not necessary. Something like this: $table->foreignId('user_id')->constrained(); Thanks.
You are right constraints are required. But only when I want to have that kind of constraint function. Why I didn't do this is primarily - I may ban or delete a user. However, the videos are from youtube and hence I want to keep that. Plus, those videos have comments which is data for me. So, why add the constraint. Makes sense? However, one thing which can be done is delete comments if video is deleted. Because, without the video the comment makes no sense
It will work. But, what if we have third? Also, it's easier to read video type as RU-vid and Vimeo rather than 0 or 1. Because then anyone new to the app will find it difficult. It will always require a documentation or some comment for the developers to understand.
Nice video. Thank you. But TDD it is when you create tests at start and then controller. But you did not in that order :). Also we can do just like this: Video::create($postData) But in general - video is very helpfull
Yes, you are right... Test driven development means first i write the test. Some times, I am able to do that. But many times, I end up writing code first and then the tests. That's what I mentioned in the earlier videos as well that I will do tdd for some cases while for some tests will follow. However, the coverage will be there and that's what I feel is more important.
For anyone actually looking for videos to learn how to do Test Driven Development, I’d like to point out that the title of this series is misleading as it doesn’t demonstrate Test Driven Development (TDD) at all. Instead, it just shows a bunch of production code and tests for it. This isn’t TDD. The first ‘D’ in TDD means “Driven”. Nothing in this series of videos shows the development being driven by tests! In TDD, the fundamental point is you write a SINGLE TEST FIRST, that test fails, then you write the least amount of code to get that test to pass, then you refactor the code you just wrote. Then you write another SINGLE failing test and repeat the process. Thus the TESTS DRIVE the development = TDD. All this series does is show you how to write feature tests for a Laravel app. It says nothing about how to do TDD.
I do understand what you mean. Problem is, I don't find that much time to do that. And hence, I always rely on short videos. If you see recently there is a huge gap between videos
@@amitavroydev I meant your short courses are great but something like a big project with Next Typescript Laravel with Testing if it's paid it benefits many of us. If you publish courses you might have motivation