Пример #1
0
 /**
  * @test
  */
 public function copyEventRedirectsToRequestUrl()
 {
     /** @var tx_seminars_Mapper_Event|PHPUnit_Framework_MockObject_MockObject $mapper */
     $mapper = $this->getMock('tx_seminars_Mapper_Event', array('save'));
     Tx_Oelib_MapperRegistry::set('tx_seminars_Mapper_Event', $mapper);
     /** @var tx_seminars_Model_Event $event */
     $event = $mapper->getLoadedTestingModel(array());
     $className = $this->createAccessibleProxyClass();
     /** @var tx_seminars_FrontEnd_DefaultController $fixture */
     $fixture = new $className();
     $fixture->copyEvent($event);
     $currentUrl = t3lib_div::locationHeaderUrl(t3lib_div::getIndpEnv('REQUEST_URI'));
     self::assertSame('Location: ' . $currentUrl, $this->headerCollector->getLastAddedHeader());
 }
Пример #2
0
 /**
  * @test
  *
  * @expectedException BadMethodCallException
  */
 public function setThrowsExceptionIfTheMapperTypeAlreadyIsRegistered()
 {
     Tx_Oelib_MapperRegistry::get('Tx_Oelib_Tests_Unit_Fixtures_TestingMapper');
     $mapper = new tx_oelib_Tests_Unit_Fixtures_TestingMapper();
     Tx_Oelib_MapperRegistry::set('Tx_Oelib_Tests_Unit_Fixtures_TestingMapper', $mapper);
 }