You are here

public function Framework_AssertTest::testReadAttribute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/Framework/AssertTest.php \Framework_AssertTest::testReadAttribute()

@covers PHPUnit_Framework_Assert::readAttribute @covers PHPUnit_Framework_Assert::getStaticAttribute @covers PHPUnit_Framework_Assert::getObjectAttribute

File

vendor/phpunit/phpunit/tests/Framework/AssertTest.php, line 1846

Class

Framework_AssertTest
@since Class available since Release 2.0.0

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'));
}