Merge pull request #8398 from open-sausages/pulls/4/test-flush

FIX Don't flush manifests in tests by default
This commit is contained in:
Robbie Averill 2018-09-25 00:19:32 +02:00 committed by GitHub
commit 3eacecbb1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();