FIX Don't flush manifests in tests by default

It's massively slowing down test execution,
particularly for rapid execution through test-driven-development (TDD)
This commit is contained in:
Ingo Schommer 2018-09-24 18:12:35 +12:00
parent 3b7802bb51
commit a2bb70c46d
2 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ Tests are run from the commandline, in your webroot folder:
* `vendor/bin/phpunit vendor/silverstripe/framework/tests/`: Run all tests of a specific module
* `vendor/bin/phpunit vendor/silverstripe/framework/tests/filesystem`: Run specific tests within a specific module
* `vendor/bin/phpunit vendor/silverstripe/framework/tests/filesystem/FolderTest.php`: Run a specific test
* `vendor/bin/phpunit vendor/silverstripe/framework/tests '' flush=all`: Run tests with optional request parameters (note the empty second argument)
* `vendor/bin/phpunit vendor/silverstripe/framework/tests '' flush=1`: Run tests with optional request parameters (note the empty second argument)
Check the PHPUnit manual for all available [command line arguments](http://www.phpunit.de/manual/current/en/textui.html).

View File

@ -983,6 +983,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
// Test application
$kernel = new TestKernel(BASE_PATH);
$app = new HTTPApplication($kernel);
$flush = array_key_exists('flush', $request->getVars());
// Custom application
$app->execute($request, function (HTTPRequest $request) {
@ -998,7 +999,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
$controller->setRequest($request);
$controller->pushCurrent();
$controller->doInit();
}, true);
}, $flush);
// Register state
static::$state = SapphireTestState::singleton();