public function Framework_AssertTest::testReadAttribute

@covers PHPUnit_Framework_Assert::readAttribute

File

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

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 testReadAttribute() {
  $obj = new ClassWithNonPublicAttributes();
  $this
    ->assertEquals('foo', $this
    ->readAttribute($obj, 'publicAttribute'));
  $this
    ->assertEquals('bar', $this
    ->readAttribute($obj, 'protectedAttribute'));
  $this
    ->assertEquals('baz', $this
    ->readAttribute($obj, 'privateAttribute'));
  $this
    ->assertEquals('bar', $this
    ->readAttribute($obj, 'protectedParentAttribute'));

  //$this->assertEquals('bar', $this->readAttribute($obj, 'privateParentAttribute'));
}