@covers PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf
public function testAssertContainsOnlyInstancesOf() {
$test = array(
new Book(),
new Book(),
);
$this
->assertContainsOnlyInstancesOf('Book', $test);
$this
->assertContainsOnlyInstancesOf('stdClass', array(
new stdClass(),
));
$test2 = array(
new Author('Test'),
);
try {
$this
->assertContainsOnlyInstancesOf('Book', $test2);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this
->fail();
}