|
15 | 15 | class TestCaseEmissionsTest extends \CIUnitTestCase |
16 | 16 | { |
17 | 17 |
|
18 | | - public function setUp() |
19 | | - { |
20 | | -// while( count( ob_list_handlers() ) > 0 ) |
| 18 | +// public function setUp() |
| 19 | +// { |
| 20 | +// while( count( ob_list_handlers() ) > 1 ) |
21 | 21 | // { |
22 | 22 | // ob_end_clean(); |
23 | 23 | // } |
24 | | - ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE); |
25 | | - } |
26 | | - |
27 | | - public function tearDown() |
28 | | - { |
29 | | - ob_end_clean(); |
30 | | - } |
| 24 | +// ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE); |
| 25 | +// } |
| 26 | +// |
| 27 | +// public function tearDown() |
| 28 | +// { |
| 29 | +// ob_end_clean(); |
| 30 | +// } |
31 | 31 |
|
32 | 32 | //-------------------------------------------------------------------- |
33 | 33 | /** |
@@ -57,18 +57,24 @@ public function testHeaderEmitted() |
57 | 57 | $response->setCookie('foo', 'bar'); |
58 | 58 | $this->assertTrue($response->hasCookie('foo')); |
59 | 59 | $this->assertTrue($response->hasCookie('foo', 'bar')); |
60 | | - |
61 | | - // send it |
| 60 | + |
62 | 61 | $response->setBody($body); |
| 62 | + |
| 63 | +//echo 'ob level at '.ob_get_level(); |
| 64 | +ob_end_clean(); |
| 65 | +ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE); |
| 66 | +//$buffer = ob_get_clean(); // flush previous |
| 67 | + // send it |
| 68 | +// $buffer = ob_get_clean(); |
63 | 69 | $response->send(); |
64 | | - |
| 70 | + $buffer = ob_end_clean(); |
65 | 71 | // and what actually got sent?; test both ways |
66 | 72 | $actual = $response->getBody(); // what we thought was sent |
67 | | -// $buffer = ob_get_clean(); |
68 | 73 |
|
69 | 74 | $this->assertEquals($expected, $actual); |
70 | 75 | $this->assertHeaderEmitted("Set-Cookie: foo=bar;"); |
71 | 76 | $this->assertHeaderEmitted("set-cookie: FOO=bar", true); |
| 77 | + |
72 | 78 | } |
73 | 79 |
|
74 | 80 | /** |
|
0 commit comments