Symfony 5 Test Driven Development (TDD) Tutorial

Symfony 5 Test Driven Development (TDD) Tutorial

Gary Clarke

3 года назад

44,793 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Thijs de Waard
Thijs de Waard - 07.07.2022 14:27

Hi Gary, sick shit! but is the api still working? I'm not able to navigate to the page of the api and not able to fetch any data.. getting a 403 response

gr thijs

Ответить
Azbrest John
Azbrest John - 14.09.2023 00:39

Wow ! I didn't think that in-memory DB can be used for unit tests , thank you !
It indeed makes sense, because these DB are temporary, and each test have its own DB... This will avoid me to use mock objects to use the EntityManager then 🙂!

Ответить
Davi
Davi - 27.04.2023 02:14

One of the best TDD videos i've seen.
Great content, mate!

Ответить
Vladyslav Svizinskyi
Vladyslav Svizinskyi - 25.02.2023 18:50

Thx Gary, as always your turorials give a lot the usefull stuf and configurations. This one is great!!! ;)

Ответить
Vazgen Manukyan
Vazgen Manukyan - 18.10.2022 09:49

Thank you. the only think that I do not understand is why you run `symfony composer` or `symfony PHP instead of just `composer` or `PHP`

Ответить
Angel Vazquez
Angel Vazquez - 15.08.2022 01:19

Finally some Symfony videos that really worth to watch...great work man

Ответить
Angelino Verhaeghe
Angelino Verhaeghe - 24.07.2022 11:19

Thanks for the video Gary, but i got an issue at 42min in the video. I want to test YahooFinanceApiClientTest in integration folder, and i got 'Undefined property: stdClass::$price' i think its due this line off code: $stockProfile = json_decode($response->getContent())->price; any idea's? Thx

Ответить
Walter D
Walter D - 22.07.2022 20:14

I've been using Symfony and Spring framework and if you learn one you learn the other one without much effort. Both are great frameworks.

Ответить
Toma Tomov
Toma Tomov - 13.07.2022 23:16

Have a question about the first unit test. Isn't this actually integrational test ? Because it interacts with the database ? We are not checking some isolated functionality but creating record and retrieving it.

Ответить
Imad Najmi
Imad Najmi - 26.06.2022 17:55

Great stuff

Ответить
Bernardo Alvarenga
Bernardo Alvarenga - 17.05.2022 09:57

Great tutorial! Thanks.
I am running into an issue though. Somehow it will not set that its running on the test environment. dd($kernel->getEnvironment()) on the DatabasePrimer will output 'dev' and then fail the check. Also it will not call the FakeYahooFinanceApiClient but the regular one. Seems that it is not at all obeying services_test.yaml.
I did compare my code to your repo and all seems fine. I am using Symfony 5.4.
Any ideas?

Ответить
soufiane lam
soufiane lam - 29.04.2022 15:23

Amazing, i appreciate your efforts to show us all this stuff in one video, thank you again

Ответить
Andrew Erwin
Andrew Erwin - 19.04.2022 18:04

I am using a newer version of Symfony. All my tests are fine, but when I run the command, I get a "syntax error" reported from JsonDecode.php. However, there is no other information about what is causing this. I have not debugged yet (I have the hardest time getting xdebug to work with cli apps, but I will get there). Curious if anyone else has come across this error or has any ideas?

Ответить
Andrew Erwin
Andrew Erwin - 18.04.2022 06:45

In the price tests, you should test for assertIsNumeric because sometimes it sends back whole dollar amounts with no cents (and it does't display xx.00) when that happens, the test will fail.

Ответить
Bikal Basnet
Bikal Basnet - 31.03.2022 14:01

Thanks Gary, very nicely done.

Ответить
Mehdi Zarrin
Mehdi Zarrin - 11.03.2022 01:17

Excellent tutorial, but you have extracted the finance API to an interface which completely dependent on Yahoo API, the fetch method should not have any arguments bonded to a specific API, maybe the next API does not require the symbol and region.

Ответить
Michael Kwabena Afreh
Michael Kwabena Afreh - 27.01.2022 14:15

This is very helpful. Simple and a good test strategy

Ответить
Mohamed CISSOKO
Mohamed CISSOKO - 03.12.2021 23:38

Thank you very much for this awesome tutorial, even the speech flow is perfect ! It is good to see the concrete process of TDD.
Do you think that it is possible to extend the process from the user story to the set of tests that should be created ?
For exemple which user story could have led to the tests functions ?
Again thanks a lot !

Ответить
Caim Astraea
Caim Astraea - 02.12.2021 00:45

Hmm I have a stupid question maybe :) Should tests belong in the main repo ? On the dev branch ? Or just keep them locally on my machine ? Because eventually what's on the dev branch will eventually be merged in the production and deployed.

Ответить
Martin Komischke
Martin Komischke - 08.11.2021 18:08

Thank you so much for this high quality content.
I learned so much from this video and appreciate how you explained all the details.
After I failed with Symfony 5.2 - I had a dependency version conflict with DAMA/doctrine ... - I was able to recode everything with Symfony 5.3 nicely.

Ответить
Ivan Savchenco
Ivan Savchenco - 29.10.2021 15:38

Who the hell has disliked this video??))))) Good job lots of thanks!s)

Ответить
Serge Maminiaina
Serge Maminiaina - 28.10.2021 06:55

Thank you

Ответить
Krzysztof Michalski
Krzysztof Michalski - 24.07.2021 19:08

Hi Gary, great course, thanks a lot!

I have created services_test.yaml with fake implementation but functional test is still using Amazon Api instead of fake implementation. I'm using Symfony 5.3. In your video you are using Symfony 5.2. Are there any changes in naming convention for yaml with tesing config?

Ответить
Leroy Jenkins
Leroy Jenkins - 21.07.2021 13:12

Thank you. Very useful.

Ответить
B1o&Leny Leny
B1o&Leny Leny - 20.07.2021 15:07

Thank you for your premium content.

Ответить
VipapkStudiosOfficial
VipapkStudiosOfficial - 04.07.2021 16:28

Awesome! Thanks Gary! :)

Ответить
Jordy Groote
Jordy Groote - 29.06.2021 01:24

Love this, thanks

Ответить
Léo R
Léo R - 20.06.2021 19:57

Amazing demo and great TDD mentoring!
This is great content 👏👏👏
I'd love to see more 🤞
Thanks for your work :)

Ответить
Steve Marvell
Steve Marvell - 13.06.2021 02:51

Just the right length

Ответить
Sokou
Sokou - 18.04.2021 14:49

i dont understand, i did everything ike you and i got this error when i tried to run test

Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000]: General error: 1 no such table: product

Ответить
Clément A
Clément A - 10.04.2021 20:22

Thanks a lot !

Ответить
f_djawid
f_djawid - 14.03.2021 16:24

Thanks for this video Gary! I have a question. I get an error when i use setUp in StockTest.php: Method 'App\Tests\StockTest::setUp()' is not compatible with method 'Symfony\Bundle\FrameworkBundle\Test\KernelTestCase::setUp()'

Do you know what causes this problem? Maybe it is because i use symfony 4? If so how can i fix this for symfony 4 because i need to use it for my usecase

Ответить
Rosita Narkute
Rosita Narkute - 09.03.2021 13:42

As for a fresh graduate programmer this course helped me A LOT while solving the technical task required for job application. Thank you, learned so many new things while double watching this course <3

Ответить
Jorge Garcés
Jorge Garcés - 28.01.2021 15:59

Awesome content Gary!! Will follow it and enjoy it this weekend!

Ответить
Shambhu Kumar
Shambhu Kumar - 28.01.2021 14:51

awesome :)

Ответить
Paweł Cyrklaf
Paweł Cyrklaf - 28.01.2021 12:21

Amazing :D If I could, I would have given it a 100 likes, but only one is possible: D

Ответить
EmaSerra onMeCode
EmaSerra onMeCode - 28.01.2021 12:04

WOW !! this is amazing !! Thank You Gary !!

Ответить