Skip to content

Commit

Permalink
Mark a test as risky when its method is annotated with @todo
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Apr 18, 2014
1 parent c00c504 commit 560c99a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,13 @@ public function runBare()
$this->testResult = $this->runTest();
$this->verifyMockObjects();
$this->assertPostConditions();

$annotations = $this->getAnnotations();

if (isset($annotations['method']['todo'])) {
throw new PHPUnit_Framework_RiskyTestError('Test method is annotated with @todo');
}

$this->status = PHPUnit_Runner_BaseTestRunner::STATUS_PASSED;
} catch (PHPUnit_Framework_IncompleteTest $e) {
$this->status = PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE;
Expand Down

0 comments on commit 560c99a

Please sign in to comment.