You are here

public function RuntimePublicReflectionPropertyTest::testGetValueOnProxyPublicProperty in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/RuntimePublicReflectionPropertyTest.php \Doctrine\Tests\Common\Reflection\RuntimePublicReflectionPropertyTest::testGetValueOnProxyPublicProperty()

File

vendor/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));
}