Neos\Flow\Tests\Unit\ObjectManagement\ObjectSerializerTest::reconstituteArrayWorksWithSplObjectStorageInTheArray PHP Method

reconstituteArrayWorksWithSplObjectStorageInTheArray() public method

    public function reconstituteArrayWorksWithSplObjectStorageInTheArray()
    {
        $objectsAsArray = ['some object' => [ObjectSerializer::CLASSNAME => 'some object', ObjectSerializer::PROPERTIES => ObjectSerializer::PROPERTIES]];
        $objectSerializer = $this->getAccessibleMock(ObjectSerializer::class, ['reconstituteSplObjectStorage'], [], '', false);
        $objectSerializer->expects($this->once())->method('reconstituteSplObjectStorage')->with([ObjectSerializer::CLASSNAME => 'some object', ObjectSerializer::PROPERTIES => ObjectSerializer::PROPERTIES])->will($this->returnValue('reconstituted object'));
        $objectSerializer->_set('objectsAsArray', $objectsAsArray);
        $dataArray = ['key1' => [ObjectSerializer::TYPE => 'simple', ObjectSerializer::VALUE => 1], 'key2' => [ObjectSerializer::TYPE => 'SplObjectStorage', ObjectSerializer::VALUE => 'some object']];
        $expectedArrayProperty = ['key1' => 1, 'key2' => 'reconstituted object'];
        $this->assertEquals($expectedArrayProperty, $objectSerializer->_call('reconstituteArray', $dataArray), 'The array was not reconstituted correctly.');
    }
ObjectSerializerTest