diff --git a/system/Test/FeatureTestCase.php b/system/Test/FeatureTestCase.php index b325aa3f5145..6f83b9e01bd0 100644 --- a/system/Test/FeatureTestCase.php +++ b/system/Test/FeatureTestCase.php @@ -34,6 +34,13 @@ class FeatureTestCase extends CIDatabaseTestCase */ protected $session = []; + /** + * Enabled auto clean op buffer after request call + * + * @var bool + */ + protected $clean = true; + /** * Sets a RouteCollection that will override * the application's route collection. @@ -115,7 +122,7 @@ public function call(string $method, string $path, array $params = null) ->run($this->routes, true); // Clean up any open output buffers - if (ob_get_level() > 0) + if (ob_get_level() > 0 && $this->clean) { ob_end_clean(); } diff --git a/tests/system/Test/FeatureTestCaseTest.php b/tests/system/Test/FeatureTestCaseTest.php index 80345b894540..f6216ba978dd 100644 --- a/tests/system/Test/FeatureTestCaseTest.php +++ b/tests/system/Test/FeatureTestCaseTest.php @@ -14,6 +14,7 @@ public function setUp() parent::setUp(); $this->skipEvents(); + $this->clean = false; } public function testCallGet()