lithium\test\Unit::assertInstanceOf()
Assert that $actual
is an instance of $expected
.
$this->assertInstanceOf('stdClass', new stdClass); // succeeds
$this->assertInstanceOf('ReflectionClass', new stdClass); // fails
Parameters
-
string
$expected
Fully namespaced expected class.
-
object
$actual
Object you are testing.
-
string|boolean
$message
Returns
booleantrue
if the assertion succeeded, false
otherwise.
Source
public function assertInstanceOf($expected, $actual, $message = '{:message}') {
return $this->assert(is_a($actual, $expected), $message, array(
'expected' => $expected,
'result' => get_class($actual)
));
}