diff --git a/system/HTTP/Response.php b/system/HTTP/Response.php index bc37e7418632..4bb1a19c92d6 100644 --- a/system/HTTP/Response.php +++ b/system/HTTP/Response.php @@ -176,6 +176,7 @@ public function __construct($config) * * @return $this * + * @internal For testing purposes only. * @testTag only available to test code */ public function pretend(bool $pretend = true) diff --git a/tests/system/Test/TestCaseTest.php b/tests/system/Test/TestCaseTest.php index ea71ddd0ac48..483ba5463046 100644 --- a/tests/system/Test/TestCaseTest.php +++ b/tests/system/Test/TestCaseTest.php @@ -13,8 +13,6 @@ use CodeIgniter\CLI\CLI; use CodeIgniter\Events\Events; -use CodeIgniter\HTTP\Response; -use Config\App; use Tests\Support\Test\TestForReflectionHelper; /** @@ -74,31 +72,6 @@ public function testStreamFilter(): void $this->assertSame($expected, $this->getStreamFilterBuffer()); } - /** - * PHPunit emits headers before we get nominal control of - * the output stream, making header testing awkward, to say - * the least. This test is intended to make sure that this - * is happening as expected. - * - * TestCaseEmissionsTest is intended to circumvent PHPunit, - * and allow us to test our own header emissions. - */ - public function testPHPUnitHeadersEmitted(): void - { - $response = new Response(new App()); - $response->pretend(true); - - $body = 'Hello'; - $response->setBody($body); - - ob_start(); - $response->send(); - ob_end_clean(); - - $this->assertHeaderEmitted('Content-type: text/html;'); - $this->assertHeaderNotEmitted('Set-Cookie: foo=bar;'); - } - public function testCloseEnough(): void { $this->assertCloseEnough(1, 1);