Skip to content

Commit a3d85f0

Browse files
authored
Merge pull request #1242 from puschie286/WorkaroundBufferProblem
workaround for buffer problem
2 parents af7e371 + 94d5383 commit a3d85f0

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

tests/system/CLI/ConsoleTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function testRun()
5757
$console->run(true);
5858
$result = CITestStreamFilter::$buffer;
5959

60+
// close open buffer
61+
ob_end_clean();
62+
6063
// make sure the result looks like a command list
6164
$this->assertContains('Lists the available commands.', $result);
6265
$this->assertContains('Displays basic usage information.', $result);

tests/system/CodeIgniterTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ public function setUp()
3131
$this->codeigniter = new MockCodeIgniter($config);
3232
}
3333

34+
public function tearDown()
35+
{
36+
parent::tearDown();
37+
38+
if( count( ob_list_handlers() ) > 1 )
39+
{
40+
ob_end_clean();
41+
}
42+
}
43+
3444
//--------------------------------------------------------------------
3545

3646
public function testRunDefaultRoute()

tests/system/Test/FeatureTestCaseTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function testCallGet()
2525
]);
2626
$response = $this->get('home');
2727

28+
// close open buffer
29+
ob_end_clean();
30+
2831
$response->assertSee('Hello World');
2932
$response->assertDontSee('Again');
3033
}

0 commit comments

Comments
 (0)