Neos\Flow\Tests\Unit\Persistence\Generic\DataMapperTest::thawPropertiesAssignsMetadataToTheProxyIfItExists PHP Метод

thawPropertiesAssignsMetadataToTheProxyIfItExists() публичный Метод

After thawing the properties, metadata in the object data will be set as a special proxy property.
    public function thawPropertiesAssignsMetadataToTheProxyIfItExists()
    {
        $className = 'Class' . md5(uniqid(mt_rand(), true));
        eval('class ' . $className . ' { public $Flow_Persistence_Metadata; }');
        $object = new $className();
        $objectData = ['identifier' => 'c254d2e0-825a-11de-8a39-0800200c9a66', 'classname' => 'TYPO3\\Post', 'properties' => [], 'metadata' => ['My_Metadata' => 'Test']];
        $classSchema = new ClassSchema('TYPO3\\Post');
        $mockReflectionService = $this->createMock(ReflectionService::class);
        $mockReflectionService->expects($this->once())->method('getClassSchema')->will($this->returnValue($classSchema));
        $dataMapper = $this->getAccessibleMock(Persistence\Generic\DataMapper::class, ['dummy']);
        $dataMapper->injectReflectionService($mockReflectionService);
        $dataMapper->_call('thawProperties', $object, $objectData['identifier'], $objectData);
        $this->assertAttributeEquals(['My_Metadata' => 'Test'], 'Flow_Persistence_Metadata', $object);
    }