/**
  * @covers ::setConfiguration
  * @covers ::getConfiguration
  */
 public function testGetConfiguration()
 {
     $configuration = array($this->randomMachineName() => mt_rand()) + $this->sut->defaultConfiguration();
     $return = $this->sut->setConfiguration($configuration);
     $this->assertNull($return);
     $this->assertSame($configuration, $this->sut->getConfiguration());
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function configuration()
 {
     $this->fixture->setConfiguration(['test' => 'test']);
     $this->assertEquals(['test' => 'test'], $this->fixture->getConfiguration());
     $this->fixture->addConfiguration('test2', 'test2');
     $this->assertEquals(['test' => 'test', 'test2' => 'test2'], $this->fixture->getConfiguration());
 }
 /**
  * @test
  */
 public function cachingOfActionsCanNotBeChanged()
 {
     $configuration = array('extensionName' => 'CurrentExtensionName', 'pluginName' => 'CurrentPluginName', 'switchableControllerActions' => array('Controller1' => array('newAction', 'action1'), 'Controller2' => array('newAction2', 'action4', 'action5')));
     $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
     $this->abstractConfigurationManager->setConfiguration($configuration);
     $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
     $this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions));
     $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;')));
     $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
     $expectedResult = array('Controller1' => array('actions' => array('newAction', 'action1')), 'Controller2' => array('actions' => array('newAction2', 'action4', 'action5'), 'nonCacheableActions' => array('action4')));
     $actualResult = $mergedConfiguration['controllerConfiguration'];
     $this->assertEquals($expectedResult, $actualResult);
 }
 /**
  * @covers ::setConfiguration
  * @covers ::getConfiguration
  */
 public function testGetConfiguration()
 {
     $configuration = ['foo' => $this->randomMachineName()];
     $this->assertNull($this->sut->setConfiguration($configuration));
     $this->assertSame($configuration, $this->sut->getConfiguration());
 }
 /**
  * @covers ::setConfiguration
  * @covers ::getConfiguration
  */
 public function testGetConfiguration()
 {
     $configuration = array($this->randomMachineName());
     $this->assertSame($this->sut, $this->sut->setConfiguration($configuration));
     $this->assertSame($configuration, $this->sut->getConfiguration());
 }