diff --git a/docs/en/02_Developer_Guides/06_Testing/index.md b/docs/en/02_Developer_Guides/06_Testing/index.md index a29fe38dc..e00266f07 100644 --- a/docs/en/02_Developer_Guides/06_Testing/index.md +++ b/docs/en/02_Developer_Guides/06_Testing/index.md @@ -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). diff --git a/src/Dev/SapphireTest.php b/src/Dev/SapphireTest.php index 988f7f087..56ba0c44b 100644 --- a/src/Dev/SapphireTest.php +++ b/src/Dev/SapphireTest.php @@ -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();