public function RuntimePublicReflectionPropertyTest::testGetValueOnProxyPublicProperty in Plug 7
File
- lib/
doctrine/ common/ tests/ Doctrine/ Tests/ Common/ Reflection/ RuntimePublicReflectionPropertyTest.php, line 11
Class
Namespace
Doctrine\Tests\Common\ReflectionCode
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));
}