public function initializeObject() { $typoScriptArray = $this->frontendConfigurationManager->getTypoScriptSetup(); if (is_array($typoScriptArray)) { $ts = $this->typoScriptService->convertTypoScriptArrayToPlainArray($typoScriptArray); $this->settings = $ts['plugin']['tx_typo3forum']['settings']; } }
/** * @return array */ protected function getSettings() { if ($this->settings === NULL) { $ts = $this->typoScriptService->convertTypoScriptArrayToPlainArray($this->frontendConfigurationManager->getTypoScriptSetup()); $this->settings = $ts['plugin']['tx_typo3forum']['settings']; } return $this->settings; }
/** * Get FileObject from collection descending * * @param string $sorting Sorting direction * @param string $fileName The filename * * @test * @dataProvider sortingDataProviderDesc * * @return void */ public function getFileObjectFromCollectionDesc($sorting, $fileName) { $this->fileCollectionMock->expects($this->any())->method('getItems')->will($this->returnValue($this->getFileFixture($sorting))); $this->frontendConfigurationManagerMock->expects($this->once())->method('getConfiguration')->will($this->returnValue(array('settings' => array('order' => 'desc')))); $imageItems = $this->subject->getFileObjectsFromCollection(array(1)); $itemCount = count($imageItems); for ($i = 0; $i < $itemCount; $i++) { $this->assertEquals($fileName[$i], $imageItems[$i]->getName()); } }
/** * @test */ public function overrideConfigurationFromFlexFormChecksForDataIsArrayAndEmpty() { /** @var $flexFormService \TYPO3\CMS\Extbase\Service\FlexFormService|\PHPUnit_Framework_MockObject_MockObject */ $flexFormService = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\FlexFormService', array('convertFlexFormContentToArray')); $flexFormService->expects($this->never())->method('convertFlexFormContentToArray'); $this->frontendConfigurationManager->_set('flexFormService', $flexFormService); $this->mockContentObject->data = array('pi_flexform' => array()); $frameworkConfiguration = array('persistence' => array('storagePid' => '98')); $this->assertSame(array('persistence' => array('storagePid' => '98')), $this->frontendConfigurationManager->_call('overrideConfigurationFromFlexForm', $frameworkConfiguration)); }
/** * Sorts the Result Array according to the Flexform Settings * * @param array $imageItems The image items * * @return array */ protected function sortFileObjects($imageItems) { $lowercase = array_map(function ($n) { return strtolower($n->getName()); }, $imageItems); if ($this->frontendConfigurationManager->getConfiguration()['settings']['order'] === 'desc') { array_multisort($lowercase, SORT_DESC, SORT_STRING, $imageItems); } else { array_multisort($lowercase, SORT_ASC, SORT_STRING, $imageItems); } return $imageItems; }
public function initializeObject() { $ts = $this->typoScriptService->convertTypoScriptArrayToPlainArray(\TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::getTypoScriptSetup()); $this->settings = $ts['plugin']['tx_typo3forum']['settings']; }