Тёмный

01 Laravel testing our Controller code - Laravel TDD 

Amitav Roy
Подписаться 19 тыс.
Просмотров 8 тыс.
50% 1

Опубликовано:

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@luizmeier
@luizmeier 3 года назад
Great topic. Starting it now; (you just got another subscriber).
@amitavroydev
@amitavroydev 3 года назад
Awesome, thanks 👍
@Madadi_Uk
@Madadi_Uk Год назад
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.
@amitavroydev
@amitavroydev Год назад
Glad it was useful.
@zubair.mohsin
@zubair.mohsin 3 года назад
Beginner friendly. Really helpful. One feedback is that instead of using 0/1 you can consider using true/false with casting in place on model.
@amitavroydev
@amitavroydev 3 года назад
Thanks for the suggestion
@Quynn-Oneal
@Quynn-Oneal 3 года назад
great video. thanks a lot
@amitavroydev
@amitavroydev 3 года назад
Glad you liked it!
@ankgne
@ankgne 3 года назад
Great video , very well articulated. Subscribed as well
@amitavroydev
@amitavroydev 3 года назад
Thanks for the feedback. Stay tuned as more videos are coming soon
@dipuchundradey
@dipuchundradey 3 года назад
Thanks for this video. I heard the name of your channel from Bitfumes. I think I can learn something from Laravel Advance from this channel
@amitavroydev
@amitavroydev 3 года назад
Thanks to bitfumes for that. Sarthak is a great friend of mine. And yes, I would be happy if you're able to learn things which you are looking for
@santiagopereyramarchetti6287
why you use this sintax: public function () : BelongsTo { } ? What is the function of the : after the ()?
@amitavroydev
@amitavroydev Год назад
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
@santiagopereyramarchetti6287
@@amitavroydev Thnks for the answer, good channel. You have a new subscriber!! :D
@amitavroydev
@amitavroydev Год назад
That's so nice of you.. cheers
@atulsharma3993
@atulsharma3993 3 года назад
Thanks u so much sir Please make videos on unit testing with factory
@amitavroydev
@amitavroydev 3 года назад
Yes, I am going to cover a lot more stuff soon.
@atulsharma3993
@atulsharma3993 3 года назад
@@amitavroydev thanks u so much sir
@kamleshpaul414
@kamleshpaul414 3 года назад
how can do complex test like stripe test facebook SDK test ?
@amitavroydev
@amitavroydev 3 года назад
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.
@kamleshpaul414
@kamleshpaul414 3 года назад
@@amitavroydev yes stripe account is free and it available in india as well since last year it good on recurring payment like subscription
@amitavroydev
@amitavroydev 3 года назад
Ok, will check
@jhonatanvidal2620
@jhonatanvidal2620 3 года назад
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.
@amitavroydev
@amitavroydev 3 года назад
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
@jhonatanvidal2620
@jhonatanvidal2620 3 года назад
Thank you very much for the answer.
@neerajsinghtangariya2587
@neerajsinghtangariya2587 3 года назад
sir what are the advantage of enum instead of boolean value use like if value is 1 then youtuber if 0 then vimeo..
@amitavroydev
@amitavroydev 3 года назад
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.
@neerajsinghtangariya2587
@neerajsinghtangariya2587 3 года назад
@@amitavroydev thank you sir I understand... sir plz provide github code as well for future reading...
@ГавриленкоМаксим-н9г
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
@amitavroydev
@amitavroydev 2 года назад
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.
@theceilidhboy
@theceilidhboy 2 года назад
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.
@amitavroydev
@amitavroydev Год назад
I do agree..
@debjit21
@debjit21 3 года назад
Please share the Github repo.
@amitavroydev
@amitavroydev 3 года назад
Done. Description updated.
@debjit21
@debjit21 3 года назад
@@amitavroydev thank you.
@debjit21
@debjit21 3 года назад
please share your GitHub repo.
@amitavroydev
@amitavroydev 3 года назад
Done. Description updated.
@cultureofnepal2024
@cultureofnepal2024 3 года назад
Hay Amitav plz share the github repo too.
@amitavroydev
@amitavroydev 3 года назад
Done. Description updated.
@tanzimibthesam5861
@tanzimibthesam5861 3 года назад
Why don't you create premium content? Yes free resources are great but through things would be great
@amitavroydev
@amitavroydev 3 года назад
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
@tanzimibthesam5861
@tanzimibthesam5861 3 года назад
@@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
Далее
Как тестировать Laravel?
1:02:47
Просмотров 17 тыс.
Why does JavaScript's fetch make me wait TWICE?
6:23
Laravel TDD in "Live" Mode: Checkout Code Review
36:04
Using docker in unusual ways
12:58
Просмотров 448 тыс.
Laravel Test Driven API - Course Intro
16:50
Просмотров 17 тыс.
Laravel First Impressions From A JavaScript Dev
21:08
Просмотров 131 тыс.