/**
* @covers PHPUnit_Framework_Constraint_ObjectHasAttribute
* @covers PHPUnit_Framework_Constraint_Not
* @covers PHPUnit_Framework_Assert::objectHasAttribute
* @covers PHPUnit_Framework_Assert::logicalNot
*/
public function testConstraintObjectNotHasAttribute2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::objectHasAttribute('foo'));
$o = new stdClass();
$o->foo = 'bar';
try {
$constraint->fail($o, 'custom message', TRUE);
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals("custom message\nFailed asserting that object of class \"stdClass\" does not have attribute \"foo\".", $e->getDescription());
return;
}
$this->fail();
}