/**
  * @test
  */
 public function uriForSetsPluginNameFromRequestIfPluginNameIsNotSet()
 {
     $this->request->expects($this->once())->method('getPluginName')->will($this->returnValue('SomePluginNameFromRequest'));
     $expectedArguments = array('tx_someextension_somepluginnamefromrequest' => array('controller' => 'SomeController'));
     $this->uriBuilder->uriFor(NULL, array(), 'SomeController', 'SomeExtension');
     $this->assertEquals($expectedArguments, $this->uriBuilder->getArguments());
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function uriForDisablesCacheHashForNonCacheableActions()
 {
     $mockConfiguration = array('controllerConfiguration' => array('SomeController' => array('nonCacheableActions' => array('someNonCacheableAction'))));
     $mockConfigurationManager = $this->getMock('Tx_Extbase_Configuration_ConfigurationManagerInterface');
     $mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($mockConfiguration));
     $mockObjectManager = $this->getMock('Tx_Extbase_Object_ObjectManager');
     $mockObjectManager->expects($this->any())->method('get')->with('Tx_Extbase_Configuration_ConfigurationManagerInterface')->will($this->returnValue($mockConfigurationManager));
     t3lib_div::setSingletonInstance('Tx_Extbase_Object_ObjectManager', $mockObjectManager);
     $this->assertTrue($this->uriBuilder->getUseCacheHash());
     $this->uriBuilder->uriFor('someNonCacheableAction', array(), 'SomeController', 'SomeExtension');
     $this->assertFalse($this->uriBuilder->getUseCacheHash());
     t3lib_div::purgeInstances();
 }