Example #1
0
 /**
  * @test
  */
 public function processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface()
 {
     $typoScript = array(10 => $this->getUniqueId('postprocess'), 20 => \TYPO3\CMS\Form\Tests\Unit\Fixtures\PostProcessorWithoutInterfaceFixture::class);
     $this->subject->typoScript = $typoScript;
     $this->subject->expects($this->once())->method('sortTypoScriptKeyList')->will($this->returnValue(array(10, 20)));
     $returnValue = $this->subject->process();
     $this->assertEquals('', $returnValue);
 }
 /**
  * @test
  */
 public function processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface()
 {
     $classNameWithoutInterface = uniqid('postprocess');
     eval('namespace TYPO3\\CMS\\Form\\PostProcess;' . 'class ' . $classNameWithoutInterface . 'PostProcessor {' . '  public function __construct(\\TYPO3\\CMS\\Form\\Domain\\Model\\Form $form, array $typoScript) {' . '  }' . '  public function process() {' . '    return \'withoutInterface\';' . '  }' . '}');
     $typoScript = array(10 => uniqid('postprocess'), 20 => $classNameWithoutInterface);
     $this->fixture->typoScript = $typoScript;
     $this->fixture->expects($this->once())->method('sortTypoScriptKeyList')->will($this->returnValue(array(10, 20)));
     $returnValue = $this->fixture->process();
     $this->assertEquals('', $returnValue);
 }
 /**
  * @test
  */
 public function processUsesLocalLayoutIfSet()
 {
     $processorConfig = array('layout.' => array('label' => '<div class="local"><labelvalue /></div>'), 'recipientEmail' => '*****@*****.**', 'senderEmail' => '*****@*****.**');
     $typoScript = array('layout.' => array('label' => '<div class="global"><labelvalue /></div>'), '1' => 'foo', '1.' => $processorConfig);
     $subject = new PostProcessor($this->formProphecy->reveal(), $typoScript);
     $this->typoScriptFactoryProphecy->setLayoutHandler($processorConfig)->willReturn($this->typoScriptLayoutProphecy->reveal());
     $this->assertEquals('', $subject->process());
 }