public function thawPropertiesFollowsOrderOfGivenObjectData()
{
$className = 'Class' . md5(uniqid(mt_rand(), true));
eval('class ' . $className . ' { protected $properties = []; public function __set($name, $value) { $this->properties[] = [$name => $value]; } }');
$object = new $className();
$objectData = ['identifier' => '1234', 'classname' => 'TYPO3\\Post', 'properties' => ['secondProperty' => ['type' => 'string', 'multivalue' => false, 'value' => 'secondValue'], 'firstProperty' => ['type' => 'string', 'multivalue' => false, 'value' => 'firstValue'], 'thirdProperty' => ['type' => 'string', 'multivalue' => false, 'value' => 'thirdValue']]];
$classSchema = new ClassSchema('TYPO3\\Post');
$classSchema->addProperty('firstProperty', 'string');
$classSchema->addProperty('secondProperty', 'string');
$classSchema->addProperty('thirdProperty', 'string');
$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, '1234', $objectData);
// the order of setting those is important, but cannot be tested for now (static setProperty)
$expected = [['secondProperty' => 'secondValue'], ['firstProperty' => 'firstValue'], ['thirdProperty' => 'thirdValue'], ['Persistence_Object_Identifier' => '1234']];
$this->assertAttributeSame($expected, 'properties', $object);
}