Ejemplo n.º 1
0
 /**
  * @test
  */
 public function buildTypolinkConfigurationResolvesDefaultPageTypeFromFormatIfFormatIsNotMapped()
 {
     $this->uriBuilder->setTargetPageUid(123);
     $this->uriBuilder->setFormat('txt');
     $mockConfigurationManager = $this->getMock(ConfigurationManager::class);
     $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue(array(array('view' => array('formatToPageTypeMapping' => array('pdf' => 2))))));
     $this->uriBuilder->_set('configurationManager', $mockConfigurationManager);
     $this->mockExtensionService->expects($this->any())->method('getTargetPageTypeByFormat')->with(null, 'txt')->will($this->returnValue(0));
     $expectedConfiguration = array('parameter' => '123,0', 'useCacheHash' => 1);
     $actualConfiguration = $this->uriBuilder->_call('buildTypolinkConfiguration');
     $this->assertEquals($expectedConfiguration, $actualConfiguration);
 }