You are here

public function RuntimePublicReflectionPropertyTest::testGetValueOnProxyPublicProperty in Plug 7

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Reflection/RuntimePublicReflectionPropertyTest.php, line 11

Class

RuntimePublicReflectionPropertyTest

Namespace

Doctrine\Tests\Common\Reflection

Code

public function testGetValueOnProxyPublicProperty() {
  $getCheckMock = $this
    ->getMock('stdClass', array(
    'callGet',
  ));
  $getCheckMock
    ->expects($this
    ->never())
    ->method('callGet');
  $initializer = function () use ($getCheckMock) {
    call_user_func($getCheckMock);
  };
  $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock();
  $mockProxy
    ->__setInitializer($initializer);
  $reflProperty = new RuntimePublicReflectionProperty(__NAMESPACE__ . '\\RuntimePublicReflectionPropertyTestProxyMock', 'checkedProperty');
  $this
    ->assertSame('testValue', $reflProperty
    ->getValue($mockProxy));
  unset($mockProxy->checkedProperty);
  $this
    ->assertNull($reflProperty
    ->getValue($mockProxy));
}