Symfony 5 Test Driven Development (TDD) Tutorial

preview_player
Показать описание
ℹ In this 80 minute recording, I will build out a Symfony service, using Test Driven Development, which is able to make an HTTP request to an API and then store some of the returned data in a database.

💻Source code here:

👇Follow me on Social Media:


Chapters:
0:00 Introduction / course overview
1:38 RapidAPI introduction
2:10 Create a new Symfony project
3:38 Create an SQLite in-memory test database
7:19 Write the first unit test
13:36 Part 2
14:20 Write a feature test
19:00 Create a console command
26:00 Create custom client class for requesting an API
27:41 Part 3
29:32 Create an integration test
34:49 Injecting the Symfony HttpClient component
38:08 Ping the API
42:35 Part 4
43:12 Add the Symfony Serializer component
44:53 Serializer component - deserialize into an entity
45:26 Refactoring for loosely coupled code
48:43 Create a test fake to mimic requesting the API during tests
52:22 Segmenting tests into groups
56:12 Part 5
57:33 Test handling non 200 status code responses from the API
01:01:13 Create development database using Symfony / Docker integration
01:08:24 Part 6
01:14:34 Serializer component - Update an existing entity
01:17:15 Handling unexpected errors from an API
Рекомендации по теме
Комментарии
Автор

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

thijsdewaard
Автор

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

DaviMartins
Автор

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

Rositukasss
Автор

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

velvetrev
Автор

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

FMB
Автор

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.

makomweb
Автор

amazing work Gary, thank you so much!

RastislavBostik
Автор

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

soufianelamnizeh
Автор

Thanks for the very good tutorial
In minute 15:41 command should be > `symfony console make:command app:refresh-stock-profile`

ahmedslink
Автор

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

ivansavchenco
Автор

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

vladyslavsvizinskyi
Автор

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

onparallel
Автор

This is very helpful. Simple and a good test strategy

KwabenaAfreh
Автор

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

damne
Автор

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 🙂!

azbrestjohn
Автор

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.

walterdiaz
Автор

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.

AndrewErwin
Автор

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.

CaimAstraea
Автор

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.

mehdiphpbb
Автор

I'm traying to do it, but in the minute 13:17 get this error:
1)
Class "App\Entity\Stock" is not a valid entity or mapped super class.

Some idea?

miguelangeljordan