protected function setUp() { parent::setUp(); $this->viewHelper = $this->getAccessibleMock(CheckboxViewHelper::class, array('setErrorClassAttribute', 'getName', 'getValueAttribute', 'isObjectAccessorMode', 'getPropertyValue', 'registerFieldNameForFormTokenGeneration')); $this->arguments['property'] = ''; $this->injectDependenciesIntoViewHelper($this->viewHelper); $this->viewHelper->initializeArguments(); }
/** * @test */ public function standardTagAttributesAreRegistered() { $mockTagBuilder = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder', array('addAttribute'), array(), '', FALSE); $mockTagBuilder->expects($this->at(0))->method('addAttribute')->with('class', 'classAttribute'); $mockTagBuilder->expects($this->at(1))->method('addAttribute')->with('dir', 'dirAttribute'); $mockTagBuilder->expects($this->at(2))->method('addAttribute')->with('id', 'idAttribute'); $mockTagBuilder->expects($this->at(3))->method('addAttribute')->with('lang', 'langAttribute'); $mockTagBuilder->expects($this->at(4))->method('addAttribute')->with('style', 'styleAttribute'); $mockTagBuilder->expects($this->at(5))->method('addAttribute')->with('title', 'titleAttribute'); $mockTagBuilder->expects($this->at(6))->method('addAttribute')->with('accesskey', 'accesskeyAttribute'); $mockTagBuilder->expects($this->at(7))->method('addAttribute')->with('tabindex', 'tabindexAttribute'); $this->viewHelper->_set('tag', $mockTagBuilder); $arguments = array('class' => 'classAttribute', 'dir' => 'dirAttribute', 'id' => 'idAttribute', 'lang' => 'langAttribute', 'style' => 'styleAttribute', 'title' => 'titleAttribute', 'accesskey' => 'accesskeyAttribute', 'tabindex' => 'tabindexAttribute'); $this->viewHelper->_call('registerUniversalTagAttributes'); $this->viewHelper->setArguments($arguments); $this->viewHelper->initializeArguments(); $this->viewHelper->initialize(); }