/** * @test */ public function resolvesConvertsDomainObjectsToIdentityArrays() { $object1 = new \stdClass(); $object2 = new \stdClass(); $originalArray = array('foo' => 'bar', 'someObject' => $object1, 'baz' => array('someOtherObject' => $object2)); $convertedArray = array('foo' => 'bar', 'someObject' => array('__identity' => 'x'), 'baz' => array('someOtherObject' => array('__identity' => 'y'))); $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class); $mockPersistenceManager->expects($this->once())->method('convertObjectsToIdentityArrays')->with($originalArray)->will($this->returnValue($convertedArray)); $this->inject($this->route, 'persistenceManager', $mockPersistenceManager); $this->route->setUriPattern('foo'); $this->route->setAppendExceedingArguments(true); $this->route->_set('isParsed', true); $this->route->resolves($originalArray); $actualResult = $this->route->getResolvedUriPath(); $expectedResult = '?foo=bar&someObject%5B__identity%5D=x&baz%5BsomeOtherObject%5D%5B__identity%5D=y'; $this->assertEquals($expectedResult, $actualResult); }