06 Nov 2024 ~ 1 min read

Create Web-API with Symfony part 2


Create Unit-test for a command

Install neccessary bundles

symfony composer require --dev phpunit/phpunit:^9.6
symfony composer require --dev symfony/test-pack

make test

symfony console make:unit-test

run tests

symfony php bin/phpunit

Headshot of Jurij Schlaht

Hi, I'm Jurij. I'm a web developer, macOS system administrator, photographer and soon also data engineer based in Frankfurt. You can follow me on Instagram, see some of my work on GitHub, or read more about me here on this page.