Category: phpunit

Symfony: refresh test database for phpunit testing with autoincrements reset on fixtures added

I want to create a fresh in memory sqlite test database to run my test against every time I run bin/phpunit. The solutions I have found so far empty the test database, but when I add the fixtures, their ids…

How do i test a method of class that execute an method with an anonymous function as arguments?

For specific needs, i have to test Kernel class in symfony 4.4 project and all is fine except method below registerContainerConfiguration(). It contains only one method that takes an argument as an Anonymous function, how could i test it entirely…

Symfony, PHPUnit : Client Webdriver Authentication

I need to authenticate my WebDriver Client for functional tests. For example, In my integration tests, i’m doing something like that : namespace TestsController; use AppEntityDonor; use AppEntityUser; use DoctrineORMEntityManager; use DoctrineORMToolsSchemaTool; use SebastianBergmannTypeRuntimeException; use SymfonyBundleFrameworkBundleTestWebTestCase; class DonorTest extends WebTestCase…

Symfony 4 – PHPUnit – Difficults with the setUp() method

I’m following the Symfony Cast Stripe formation. They use Symfony 3 and I use Symfony 4. I try to make some test like in the formation : https://symfonycasts.com/screencast/stripe-level2/testing-webhooks#play But when I run the test, I’ve this error : Fatal error:…