Skip to content

Commit 67436e3

Browse files
authored
Merge pull request #8586 from kenjis/remove-TestCaseTest-testPHPUnitHeadersEmitted
test: remove meaningless `TestCaseTest::testPHPUnitHeadersEmitted()`
2 parents 00c2ab9 + 29717da commit 67436e3

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

system/HTTP/Response.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public function __construct($config)
176176
*
177177
* @return $this
178178
*
179+
* @internal For testing purposes only.
179180
* @testTag only available to test code
180181
*/
181182
public function pretend(bool $pretend = true)

tests/system/Test/TestCaseTest.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
use CodeIgniter\CLI\CLI;
1515
use CodeIgniter\Events\Events;
16-
use CodeIgniter\HTTP\Response;
17-
use Config\App;
1816
use Tests\Support\Test\TestForReflectionHelper;
1917

2018
/**
@@ -74,31 +72,6 @@ public function testStreamFilter(): void
7472
$this->assertSame($expected, $this->getStreamFilterBuffer());
7573
}
7674

77-
/**
78-
* PHPunit emits headers before we get nominal control of
79-
* the output stream, making header testing awkward, to say
80-
* the least. This test is intended to make sure that this
81-
* is happening as expected.
82-
*
83-
* TestCaseEmissionsTest is intended to circumvent PHPunit,
84-
* and allow us to test our own header emissions.
85-
*/
86-
public function testPHPUnitHeadersEmitted(): void
87-
{
88-
$response = new Response(new App());
89-
$response->pretend(true);
90-
91-
$body = 'Hello';
92-
$response->setBody($body);
93-
94-
ob_start();
95-
$response->send();
96-
ob_end_clean();
97-
98-
$this->assertHeaderEmitted('Content-type: text/html;');
99-
$this->assertHeaderNotEmitted('Set-Cookie: foo=bar;');
100-
}
101-
10275
public function testCloseEnough(): void
10376
{
10477
$this->assertCloseEnough(1, 1);

0 commit comments

Comments
 (0)