Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixing the test printing! #1
This should fix the errors printing when the tests fail. More details here: https://symfonycasts.com/screencast/symfony-rest/mad-test-debugging#comment-4313251967
… in testing.php. No matter how many tests we run we only need to create the client once at the beginning of the test suite. After that we pass this instance at thr beginning of every test
Extract entity manager service from container. The whole point of that KernelTestCase base class is to set and boot that static $ kernel property which has the container on it. Now normally, the base class actually shuts down the kernel in tearDown(). What I'm doing - on purpose - is booting the kernel and creating the container just once per my whole test suite. That'll make things faster, though in theory it could cause issues or even slow things down eventually. You can experiment by shutting down your kernel in tearDown() and booting it in setup() if you want. Or even just clearing the EntityManager to avoid a lot of entities getting stuck inside of it after a bunch of tests. Purge database before every test suite. We still have 500 error when run 'bin/phpunit'
… onNotSuccessfullTest phpunit method and debugResponse method to match the new 500 error Symfony page markup.
If I run bin/phpunit now console stops right in die line. So onNotSuccessfullTest is trigerred.
} That means self::$ history is an empty array. Because of this getLastResponseMethod return null so if block is never executed. Why this self::$ history is never populated I don't know
First command install the new browser testing panther tool. I don't use --dev option because I need this in test environment. Second command start the new panther browser