Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Asserting invalid form should throw better exception #3

Open
rozsival opened this issue Dec 8, 2019 · 2 comments
Open

Asserting invalid form should throw better exception #3

rozsival opened this issue Dec 8, 2019 · 2 comments

Comments

@rozsival
Copy link
Member

rozsival commented Dec 8, 2019

Using FormAsserts::assertValidForm on an invalid form in a presenter test case results with Uncaught Nette\NotImplementedException: Object serialization is not supported by class <presenterClassName> in <projectRoot>/vendor/nette/component-model/src/ComponentModel/Component.php:298

Dependencies:

  • nette/application: 3.0.2
  • nette/forms: 3.0.2

It would be much clearer if the test failed the same way as with phpunit core asserts simply saying that asserting caused the failure.

@rozsival
Copy link
Member Author

Turns out it's not a form assert issue. This happens with any DIContainerTestCase failed assertion while phpunit.xml has processIsolation="true".

@rozsival
Copy link
Member Author

PHPUnit\Framework\Exception: PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in Standard input code:423
Stack trace:
#0 Standard input code(423): serialize(Array)
#1 Standard input code(580): __phpunit_run_isolated_test()
#2 {main}
  thrown in Standard input code on line 423

Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in Standard input code on line 423

Exception: Serialization of 'Closure' is not allowed in Standard input code on line 423

Call Stack:
    0.0013     638448   1. {main}() Standard input code:0
    0.0232    3385216   2. __phpunit_run_isolated_test() Standard input code:580
    0.9411   14565280   3. serialize() Standard input code:423

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant