Skip to content
Permalink
Browse files

Fix more risky tests.

These buffer starts offset the buffer closes that are in the test that
is being invoked with run() in the test method.
  • Loading branch information...
markstory committed Sep 28, 2014
1 parent 92bd862 commit 63b8d021864ae0eed4106efba0a0ea76958c7627
Showing with 8 additions and 0 deletions.
  1. +8 −0 tests/TestCase/TestSuite/TestCaseTest.php
@@ -37,6 +37,7 @@ class TestCaseTest extends TestCase {
public function testAssertHtmlBasic() {
$test = new AssertHtmlTestCase('testAssertHtmlQuotes');
$result = $test->run();
ob_start();
$this->assertEquals(0, $result->errorCount());
$this->assertTrue($result->wasSuccessful());
$this->assertEquals(0, $result->failureCount());
@@ -128,6 +129,7 @@ public function testAssertHtmlRuntimeComplexity() {
public function testNumericValuesInExpectationForAssertHtml() {
$test = new AssertHtmlTestCase('testNumericValuesInExpectationForAssertHtml');
$result = $test->run();
ob_start();
$this->assertEquals(0, $result->errorCount());
$this->assertTrue($result->wasSuccessful());
$this->assertEquals(0, $result->failureCount());
@@ -141,12 +143,14 @@ public function testNumericValuesInExpectationForAssertHtml() {
public function testBadAssertHtml() {
$test = new AssertHtmlTestCase('testBadAssertHtml');
$result = $test->run();
ob_start();
$this->assertEquals(0, $result->errorCount());
$this->assertFalse($result->wasSuccessful());
$this->assertEquals(1, $result->failureCount());
$test = new AssertHtmlTestCase('testBadAssertHtml2');
$result = $test->run();
ob_start();
$this->assertEquals(0, $result->errorCount());
$this->assertFalse($result->wasSuccessful());
$this->assertEquals(1, $result->failureCount());
@@ -165,6 +169,8 @@ public function testLoadFixturesOnDemand() {
$test->fixtureManager = $manager;
$manager->expects($this->once())->method('loadSingle');
$result = $test->run();
ob_start();
$this->assertEquals(0, $result->errorCount());
}
@@ -176,10 +182,12 @@ public function testLoadFixturesOnDemand() {
public function testSkipIf() {
$test = new FixturizedTestCase('testSkipIfTrue');
$result = $test->run();
ob_start();
$this->assertEquals(1, $result->skippedCount());
$test = new FixturizedTestCase('testSkipIfFalse');
$result = $test->run();
ob_start();
$this->assertEquals(0, $result->skippedCount());
}

0 comments on commit 63b8d02

Please sign in to comment.
You can’t perform that action at this time.