/** * @test */ public function optionsContainPrependedItemWithCorrectValueIfPrependOptionLabelAndPrependOptionValueAreSet() { $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName'); $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName'); $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="-1">please choose</option>' . chr(10) . '<option value="value1">label1</option>' . chr(10) . '<option value="value2">label2</option>' . chr(10) . '<option value="value3">label3</option>' . chr(10)); $this->tagBuilder->expects($this->once())->method('render'); $this->arguments['options'] = array('value1' => 'label1', 'value2' => 'label2', 'value3' => 'label3'); $this->arguments['name'] = 'myName'; $this->arguments['prependOptionLabel'] = 'please choose'; $this->arguments['prependOptionValue'] = '-1'; $this->injectDependenciesIntoViewHelper($this->viewHelper); $this->viewHelper->initialize(); $this->viewHelper->render(); }