public function Framework_AssertTest::testAssertObjectHasAttribute

@covers PHPUnit_Framework_Assert::assertObjectHasAttribute

File

drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php, line 1199

Class

Framework_AssertTest
@package PHPUnit @author Sebastian Bergmann <sebastian@phpunit.de> @author Bernhard Schussek <bschussek@2bepublished.at> @copyright 2001-2013 Sebastian Bergmann <sebastian@phpunit.de> @license …

Code

public function testAssertObjectHasAttribute() {
  $o = new Author('Terry Pratchett');
  $this
    ->assertObjectHasAttribute('name', $o);
  try {
    $this
      ->assertObjectHasAttribute('foo', $o);
  } catch (PHPUnit_Framework_AssertionFailedError $e) {
    return;
  }
  $this
    ->fail();
}