/**
  * @todo missing docblock
  */
 public static function find($pid)
 {
     // Check the own page first
     if (CheckPageUtility::hasThemeableSysTemplateRecord($pid)) {
         return $pid;
     }
     // ..then the rootline pages
     $rootLineUtility = new RootlineUtility($pid);
     $pages = $rootLineUtility->get();
     foreach ($pages as $page) {
         if (CheckPageUtility::hasThemeableSysTemplateRecord($page['pid'])) {
             return $page['pid'];
         }
     }
     return NULL;
 }
 /**
  * @test
  */
 public function getRecordArrayFetchesTranslationWhenLanguageIdIsSet()
 {
     $pageData = array('uid' => 1, 'title' => 'Original');
     $pageDataTranslated = array('uid' => 1, 'title' => 'Translated', '_PAGES_OVERLAY_UID' => '2');
     $this->subject->expects($this->any())->method('enrichWithRelationFields')->with(2, $pageDataTranslated)->will($this->returnArgument(1));
     $databaseConnectionMock = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
     $databaseConnectionMock->expects($this->once())->method('exec_SELECTgetSingleRow')->will($this->returnValue($pageData));
     $this->subject->_set('databaseConnection', $databaseConnectionMock);
     $this->pageContextMock->expects($this->any())->method('getPageOverlay')->will($this->returnValue($pageDataTranslated));
     $this->subject->_set('languageUid', 1);
     $this->assertSame($pageDataTranslated, $this->subject->_call('getRecordArray', 1));
 }
Beispiel #3
0
 /**
  * Deletes all dummy records that have been added through this framework.
  * For this, all records with the "is_dummy_record" flag set to 1 will be
  * deleted from all tables that have been used within this instance of the
  * testing framework.
  *
  * If you set $performDeepCleanUp to TRUE, it will go through ALL tables to
  * which the current instance of the testing framework has access. Please
  * consider well, whether you want to do this as it's a huge performance
  * issue.
  *
  * @param bool $performDeepCleanUp
  *        whether a deep clean up should be performed
  *
  * @return void
  *
  * @throws Exception
  */
 public function cleanUp($performDeepCleanUp = FALSE)
 {
     $this->cleanUpTableSet(FALSE, $performDeepCleanUp);
     $this->cleanUpTableSet(TRUE, $performDeepCleanUp);
     $this->deleteAllDummyFoldersAndFiles();
     $this->discardFakeFrontEnd();
     foreach ($this->getHooks() as $hook) {
         if (!$hook instanceof Tx_Phpunit_Interface_FrameworkCleanupHook) {
             throw new Exception('The class ' . get_class($hook) . ' must implement Tx_Phpunit_Interface_FrameworkCleanupHook.', 1299257923);
         }
         /** @var $hook Tx_Phpunit_Interface_FrameworkCleanupHook */
         $hook->cleanUp();
     }
     RootlineUtility::purgeCaches();
 }
 public function columnHasRelationToResolve($configuration)
 {
     return parent::columnHasRelationToResolve($configuration);
 }
Beispiel #5
0
 /**
  * Deletes all dummy records that have been added through this framework.
  * For this, all records with the "is_dummy_record" flag set to 1 will be
  * deleted from all tables that have been used within this instance of the
  * testing framework.
  *
  * If you set $performDeepCleanUp to TRUE, it will go through ALL tables to
  * which the current instance of the testing framework has access. Please
  * consider well, whether you want to do this as it's a huge performance
  * issue.
  *
  * @param bool $performDeepCleanUp whether a deep clean up should be performed, may be empty
  *
  * @return void
  */
 public function cleanUp($performDeepCleanUp = FALSE)
 {
     $this->cleanUpTableSet(FALSE, $performDeepCleanUp);
     $this->cleanUpTableSet(TRUE, $performDeepCleanUp);
     $this->deleteAllDummyFoldersAndFiles();
     $this->discardFakeFrontEnd();
     foreach ($this->getHooks() as $hook) {
         if (method_exists($hook, 'cleanUp')) {
             $hook->cleanUp($this);
         }
     }
     \TYPO3\CMS\Core\Utility\RootlineUtility::purgeCaches();
 }