Skip to content

Commit

Permalink
Merge pull request #1242 from puschie286/WorkaroundBufferProblem
Browse files Browse the repository at this point in the history
workaround for buffer problem
  • Loading branch information
jim-parry authored Sep 25, 2018
2 parents af7e371 + 94d5383 commit a3d85f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/system/CLI/ConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public function testRun()
$console->run(true);
$result = CITestStreamFilter::$buffer;

// close open buffer
ob_end_clean();

// make sure the result looks like a command list
$this->assertContains('Lists the available commands.', $result);
$this->assertContains('Displays basic usage information.', $result);
Expand Down
10 changes: 10 additions & 0 deletions tests/system/CodeIgniterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ public function setUp()
$this->codeigniter = new MockCodeIgniter($config);
}

public function tearDown()
{
parent::tearDown();

if( count( ob_list_handlers() ) > 1 )
{
ob_end_clean();
}
}

//--------------------------------------------------------------------

public function testRunDefaultRoute()
Expand Down
3 changes: 3 additions & 0 deletions tests/system/Test/FeatureTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function testCallGet()
]);
$response = $this->get('home');

// close open buffer
ob_end_clean();

$response->assertSee('Hello World');
$response->assertDontSee('Again');
}
Expand Down

0 comments on commit a3d85f0

Please sign in to comment.