|
From: Roy S. <ro...@s7...> - 2010-11-02 12:25:32
|
On Nov 2, 2010, at 5:07 AM, T.J.Hunt wrote:
> xUnit implementations typically do 1)
>
> In pseudo code, I guess it looks like
>
> foreach ($testClass->getTestMethods() as $testMethod) {
> $testClass->setUp();
> try {
> $testClass->$testMethod();
> $this->countSuccess();
> } catch(FailureException $f) {
> $this->countFailure($f);
> } catch(Exception $e) {
> if (!$this->isExpectedException($e)) {
> $this->countUnexpectedException($e);
> }
> } finally {
> $testClass->tearDown();
> }
> }
>
Yup, that's exactly the behavior I would expect. Looking at it another way:
* All test cases are independent, and can be run in any order.
* Within a test case, all test methods are independent, and can be run in any order.
* Within a test method, the individual assertions depend on each other, must be run in the specified order, and once an assertion fails, it makes no sense to run the rest of the assertions in that method.
--
Roy Smith
roy...@s7...
|