Category : simple-phpunit

I’m discovering API Platform and i’m now at the "Testing the API" step. I get two different errors I can’t resolve, event avec a composer install / update : 1) AppTestsBooksTest::testGetCollection Error: Call to undefined method ApiPlatformCoreBridgeSymfonyBundleTestConstraintArraySubsetLegacy::exporter() /srv/api/vendor/api-platform/core/src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:76 /srv/api/vendor/api-platform/core/src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:84 /srv/api/vendor/api-platform/core/src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:68 /srv/api/vendor/api-platform/core/src/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetLegacy.php:32 /srv/api/vendor/api-platform/core/src/Bridge/Symfony/Bundle/Test/ApiTestAssertionsTrait.php:100 /srv/api/vendor/api-platform/core/src/Bridge/Symfony/Bundle/Test/ApiTestAssertionsTrait.php:57 /srv/api/tests/BooksTest.php:26 and 4) AppTestsBooksTest::testUpdateBook TypeError: Argument 2 passed to ApiPlatformCoreBridgeSymfonyBundleTestClient::request() must be ..

Read more

Here is my test file: <?php // src/tests/UserActionsTest.php namespace AppTests; use SymfonyComponentPantherPantherTestCase; class UserActionsTest extends PantherTestCase { /** * An user can subscribe on the Blog */ public function testRegistration(): void { $client = static::createPantherClient(); $crawler = $client->request(‘GET’, ‘/subscribe’); // This form is generated in JavaScript $client->waitFor(‘#subscribe-form’); // Form submission $client->submitForm(‘Create the account’, [ ‘username’ ..

Read more

I’m currently introducing tests in my Symfony app. Some of them are failing and it takes ages to run them all. Is it possible to run a single test with the simpl-phpunit command ? I already tested : with the namespace of my test but ended up with ./vendor/bin/simple-phpunit ApptestsControllerDefaultControllerTest Cannot open file “ApptestsControllerDefaultControllerTest.php”. and ..

Read more