-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TestCase: tearDown() is called even on error in test method [Closes #254
][Ref #255]
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* @exitCode 255 | ||
* @outputMatch Test::setUp,Test::testMe,Test::tearDown,E_USER_ERROR: STOP%A% | ||
*/ | ||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
Tester\Environment::$useColors = FALSE; | ||
|
||
|
||
class Test extends Tester\TestCase | ||
{ | ||
protected function setUp() | ||
{ | ||
echo __METHOD__ . ','; | ||
} | ||
|
||
/** @dataProvider data */ | ||
public function testMe($arg) | ||
{ | ||
echo __METHOD__ . ','; | ||
trigger_error('STOP', E_USER_ERROR); | ||
} | ||
|
||
protected function tearDown() | ||
{ | ||
echo __METHOD__ . ','; | ||
trigger_error('NOT SHOWN', E_USER_ERROR); | ||
} | ||
|
||
protected function data() | ||
{ | ||
return array(array('arg')); | ||
} | ||
} | ||
|
||
|
||
$test = new Test; | ||
$test->run(); |