Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the test printing! #1

Open
wants to merge 11 commits into
base: master
from

Conversation

@weaverryan
Copy link

weaverryan commented Jan 29, 2019

Hi there!

This should fix the errors printing when the tests fail. More details here: https://symfonycasts.com/screencast/symfony-rest/mad-test-debugging#comment-4313251967

Cheers!

petrero and others added 11 commits Jan 12, 2019
… 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
@petre-symfony petre-symfony force-pushed the petre-symfony:master branch 3 times, most recently from 38d7685 to 08ec14c Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.