diff --git a/system/Test/FeatureTestCase.php b/system/Test/FeatureTestCase.php index 9b393257c027..dc53c42c1e4f 100644 --- a/system/Test/FeatureTestCase.php +++ b/system/Test/FeatureTestCase.php @@ -151,6 +151,15 @@ public function skipEvents() */ public function call(string $method, string $path, array $params = null) { + // Clean up any open output buffers + // not relevant to unit testing + // @codeCoverageIgnoreStart + if (\ob_get_level() > 0 && $this->clean) + { + \ob_end_clean(); + } + // @codeCoverageIgnoreEnd + // Simulate having a blank session $_SESSION = []; $_SERVER['REQUEST_METHOD'] = $method; @@ -178,16 +187,6 @@ public function call(string $method, string $path, array $params = null) $response->setBody($output); } - // Clean up any open output buffers - // not relevant to unit testing - // @codeCoverageIgnoreStart - - if (ob_get_level() > 0 && $this->clean) - { - ob_end_clean(); - } - // @codeCoverageIgnoreEnd - // Reset directory if it has been set Services::router()->setDirectory(null); diff --git a/tests/system/Test/FeatureTestCaseTest.php b/tests/system/Test/FeatureTestCaseTest.php index b89422760085..e32f738b2c46 100644 --- a/tests/system/Test/FeatureTestCaseTest.php +++ b/tests/system/Test/FeatureTestCaseTest.php @@ -5,9 +5,7 @@ use CodeIgniter\Test\FeatureResponse; /** - * @group DatabaseLive - * @runTestsInSeparateProcesses - * @preserveGlobalState disabled + * @group DatabaseLive */ class FeatureTestCaseTest extends FeatureTestCase { @@ -198,10 +196,6 @@ public function testEchoes() public function testCallZeroAsPathGot404() { $this->expectException(PageNotFoundException::class); - while (\ob_get_level() > 0) - { - \ob_end_flush(); - } $this->get('0'); } @@ -247,11 +241,6 @@ public function testOpenCliRoutesFromHttpGot404($from, $to, $httpGet) $to, ], ]); - - while (\ob_get_level() > 0) - { - \ob_end_flush(); - } $this->get($httpGet); } }