Bahjaat
241
4
Testing

PHPUNIT fails, but separate testsuits not

Posted 1 month ago by Bahjaat

I'm really struggling with my tests. Look's like the 'RefreshDatabase' is not working like I expect. I am using a mysql test database. When the test is failing more records than expected are in my table.

Running the test from PHPStorm is also successfull.

Here's some output. Can someone help me out?

phpunit --testsuite Unit

PHPUnit 7.5.12 by Sebastian Bergmann and contributors.

........................................                          40 / 40 (100%)

Time: 8.06 seconds, Memory: 48.25 MB

OK (40 tests, 42 assertions)

phpunit --testsuite Feature

PHPUnit 7.5.12 by Sebastian Bergmann and contributors.

....................                                              20 / 20 (100%)

Time: 9.02 seconds, Memory: 64.25 MB

OK (20 tests, 55 assertions)

phpunit

PHPUnit 7.5.12 by Sebastian Bergmann and contributors.

............................................F

Time: 13.41 seconds, Memory: 64.25 MB

There was 1 failure:

1) Tests\Unit\LicenseTest::scope_valid
Failed asserting that actual size 2 matches expected size 1.

/Users/edwin/code/..../tests/Unit/LicenseTest.php:33

FAILURES!
Tests: 45, Assertions: 82, Failures: 1.

Please sign in or create an account to participate in this conversation.