Main Provider - triggers only on records which have a selected action. All other page records will be associated with the SubPageProvider instead.
Inheritance: extends FluidTYPO3\Flux\Provider\AbstractProvider, implements FluidTYPO3\Flux\Provider\ProviderInterface
Example #1
0
 /**
  * @dataProvider getControllerActionFromRecordTestValues
  * @param array $record
  * @param string $fieldName
  * @param boolean $expectsMessage
  * @param string $expected
  */
 public function testGetControllerActionFromRecord(array $record, $fieldName, $expectsMessage, $expected)
 {
     $instance = new PageProvider();
     if (PageControllerInterface::DOKTYPE_RAW !== $record['doktype'] && TRUE === empty($record[$fieldName])) {
         /** @var PageService $service */
         $service = $this->getMock('FluidTYPO3\\Fluidpages\\Service\\PageService', array('getPageTemplateConfiguration'));
         $instance->injectPageService($service);
     }
     if (TRUE === $expectsMessage) {
         /** @var ConfigurationService|\PHPUnit_Framework_MockObject_MockObject $configurationService */
         $configurationService = $this->getMock('FluidTYPO3\\Fluidpages\\Service\\ConfigurationService', array('message'));
         $configurationService->expects($this->once())->method('message');
         $instance->injectConfigurationService($configurationService);
     }
     // make sure PageProvider is now using the right field name
     $instance->trigger($record, NULL, $fieldName);
     $result = $instance->getControllerActionFromRecord($record);
     $this->assertEquals($expected, $result);
 }
 /**
  * @param array $row
  * @return string
  */
 public function getControllerActionReferenceFromRecord(array $row)
 {
     $pageRow = $this->recordService->getSingle('pages', '*', $row['pid']);
     return parent::getControllerActionReferenceFromRecord($pageRow);
 }