You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a framework-only project. No silverstripe/cms package. The default test DB has the proper GRANTs set but when I'm trying to run tests using the database, it results in the error:
#> ./vendor/bin/phpunit
PHPUnit 9.6.8 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 00:01.129, Memory: 20.00 MB
There was 1 error:
1) Path\To\My\Tests\ServerTest::testMethodsAllowed
LogicException: getItemPath returned null for Path\To\My\Tests\ServerTest. Try adding flush=1 to the test run.
Adding flush=all|1 of course does nothing, as neither does rm -rf /tmp/silverstripe-cache*
Similar issues are described here in framework version 4:
I've noticed that using one or both of the following in the test class, the error goes away and the suite passes (but of course I cannot develop any tests against the database).
class ServerTest extends FunctionalTest
{
// commenting this, hides the errorprotectedstatic$fixture_file = [
'test/API/fixtures/ServerTest.yml',
];
// commenting this, hides the errorprotected$usesDatabase = true;
....
}
Poking around in SapphireTest where the exception is thrown originally, there are two spots where it can be thrown, the guilty party is FixtureTestState::getTestAbsolutePath().
I've tried moving the test suite and its fixture into the top level "test" dir = same problem.
FYI my directory structure is as follows:
+ public
+ app
+ test
- ServerTest.php
- ServerTest.yml
Affected Version
silverstripe/framework
5.0.4phpunit/phpunit
9.6.8Description
This is a framework-only project. No
silverstripe/cms
package. The default test DB has the proper GRANTs set but when I'm trying to run tests using the database, it results in the error:Adding
flush=all|1
of course does nothing, as neither doesrm -rf /tmp/silverstripe-cache*
Similar issues are described here in framework version 4:
I've noticed that using one or both of the following in the test class, the error goes away and the suite passes (but of course I cannot develop any tests against the database).
Poking around in
SapphireTest
where the exception is thrown originally, there are two spots where it can be thrown, the guilty party isFixtureTestState::getTestAbsolutePath()
.I've tried moving the test suite and its fixture into the top level "test" dir = same problem.
FYI my directory structure is as follows:
Contents of
phpunit.dist.xml
Steps to Reproduce
The text was updated successfully, but these errors were encountered: