コード例 #1
0
 /**
  * Helper function for the bound property
  *
  * @param $formObject
  */
 protected function stubVariableContainer($formObject)
 {
     $this->viewHelperVariableContainer->exists(Argument::cetera())->willReturn(true);
     $this->viewHelperVariableContainer->get(Argument::any(), 'formObjectName')->willReturn('objectName');
     $this->viewHelperVariableContainer->get(Argument::any(), 'fieldNamePrefix')->willReturn('fieldPrefix');
     $this->viewHelperVariableContainer->get(Argument::any(), 'formFieldNames')->willReturn([]);
     $this->viewHelperVariableContainer->get(Argument::any(), 'formObject')->willReturn($formObject);
     $this->viewHelperVariableContainer->get(Argument::any(), 'renderedHiddenFields')->willReturn([]);
     $this->viewHelperVariableContainer->addOrUpdate(Argument::cetera())->willReturn(null);
 }
コード例 #2
0
 /**
  * @test
  */
 public function testGetReturnsDefaultIfRequestedVariableDoesNotExist()
 {
     $subject = new ViewHelperVariableContainer();
     $this->assertEquals('test', $subject->get('foo', 'bar', 'test'));
 }
コード例 #3
0
ファイル: CycleViewHelper.php プロジェクト: typo3/fluid
 /**
  * @param string $as
  * @param ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer
  * @return integer
  */
 protected static function initializeIndex($as, ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer)
 {
     $index = 0;
     if ($viewHelperVariableContainer->exists(static::class, $as)) {
         $index = $viewHelperVariableContainer->get(static::class, $as);
     }
     return $index;
 }