public function setUp()
{
$this->mockObjectManager = $this->createMock(ObjectManagerInterface::class);
$this->route = $this->getAccessibleMock(Routing\Route::class, ['dummy']);
$this->route->_set('objectManager', $this->mockObjectManager);
$this->mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
$this->mockPersistenceManager->expects($this->any())->method('convertObjectsToIdentityArrays')->will($this->returnCallback(function ($array) {
return $array;
}));
$this->inject($this->route, 'persistenceManager', $this->mockPersistenceManager);
}