public function testConstraintIsInstanceOf() { $constraint = new PHPUnit_Framework_Constraint_IsInstanceOf('Exception'); $this->assertFalse($constraint->evaluate(new stdClass())); $this->assertTrue($constraint->evaluate(new Exception())); $this->assertEquals('is instance of class "Exception"', $constraint->toString()); try { $constraint->fail(new stdClass(), ''); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals('Failed asserting that <stdClass> is an instance of class "Exception".', $e->getDescription()); return; } $this->fail(); }