PHP in 60 SECONDS: PHPUnit Test Doubles Explained

preview_player
Показать описание
ℹ Let me show you how to make your tests more focused and they may also run faster in certain scenarios. Test doubles and, in this case, mock objects allow you to switch a real object for a mock one at test runtime.

📺 Watch the FULL video:

👇Follow me on Social Media:

💕Show support:
Рекомендации по теме
Комментарии
Автор

Good one, Have a doubt : The actual inventory class did not had any constructor injection. But in your test, you had injected the mocked repository to inventory class. I did not get how that works.

gokuljadhav.g