Пример #1
0
 function it_should_add_options_to_select_element(NodeInterface $nodeInterface, NodeInterface $optionElement1, NodeInterface $optionElement2, NodeInterface $optionElement3)
 {
     $tag_name = "option";
     $data = [1 => 'option1', 2 => 'option2', 3 => 'option3'];
     $nodeInterface->createElement($tag_name, $data[1])->willReturn($optionElement1);
     $nodeInterface->appendChild($optionElement1)->shouldBeCalled();
     $optionElement1->setAttribute('value', 1)->shouldBeCalled();
     $nodeInterface->createElement($tag_name, $data[2])->willReturn($optionElement2);
     $nodeInterface->appendChild($optionElement2)->shouldBeCalled();
     $optionElement2->setAttribute('value', 2)->shouldBeCalled();
     $nodeInterface->createElement($tag_name, $data[3])->willReturn($optionElement3);
     $nodeInterface->appendChild($optionElement3)->shouldBeCalled();
     $optionElement3->setAttribute('value', 3)->shouldBeCalled();
     $this->addOption($data);
 }