Now if you run this test case using
test suite, you will get the following result:
PHPUnit 3.0.5 by Sebastian Bergmann.
IIIIIIIIIII
Time: 00:00
OK, but incomplete or skipped tests!
Tests: 11, Incomplete: 11.
Reflection and Unit Testing
[ 126 ]
PHPUnit successfully figured out that all our tests are marked as incomplete.
Now let's think again. If you generate an InputValidator object, which
validates user input and filters all malicious data from it, then we may have only
one test case, testValidInput() instead of all these testValidUserName(),
testValidSubject(), testValidContent(). So we can skip those tests. Now let's
create the new test routine testValidInput() and mark it as incomplete:
public function testValidInput()
{
$this->markTestIncomplete();
}
What will we do with those three tests that we plan to skip? We will not delete them
but mark them as skipped. Modify the line $this->markTestIncomplete() to
$this->markTestSkipped(). For example:
public function testValidUserName()
{
$this->markTestSkipped();
}
Now if you run your test suite again you will get the following result:
PHPUnit 3.0.5 by Sebastian Bergmann.
IIIIIISSSIII
Time: 00:00
OK, but incomplete or skipped tests!
Tests: 12, Incomplete: 9, Skipped: 3.
Pages:
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141