Commit cdc9a448 authored by alexpott's avatar alexpott

Issue #2453627 by neclimdul, drunken monkey: Fix DrupalStandardsListener for non-TestCase objects

parent aecf0ace
......@@ -147,11 +147,19 @@ public function checkValidCoversForTest(\PHPUnit_Framework_TestCase $test) {
* {@inheritdoc}
*/
public function endTest(\PHPUnit_Framework_Test $test, $time) {
// \PHPUnit_Framework_TestListener interface passes us a
// \PHPUnit_Framework_Test argument in this signature, but we have to assume
// that it is a \PHPUnit_Framework_TestCase. Things are not really useful
// otherwise.
$this->checkValidCoversForTest($test);
// \PHPUnit_Framework_Test does not have any useful methods of its own for
// our purpose, so we have to distinguish between the different known
// subclasses.
if ($test instanceof \PHPUnit_Framework_TestCase) {
$this->checkValidCoversForTest($test);
}
elseif ($test instanceof \PHPUnit_Framework_TestSuite) {
foreach ($test->getGroupDetails() as $tests) {
foreach ($tests as $test) {
$this->endTest($test, $time);
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment