Example #1
0
 public function testGetChildren()
 {
     $fdSource = $this->getMock('FluentDOMCore');
     $fdSpawn = $this->getMock('FluentDOMCore');
     $dom = new DOMDocument();
     $node = $dom->creatEelement('parent');
     $node->appendChild($dom->createElement('child'));
     $fdSource->expects($this->once())->method('spawn')->will($this->returnValue($fdSpawn));
     $fdSource->expects($this->once())->method('item')->with($this->equalTo(0))->will($this->returnValue($node));
     $fdSpawn->expects($this->once())->method('push')->with($this->isInstanceOf('DOMNodeList'));
     $fdi = new FluentDOMIterator($fdSource);
     $this->assertInstanceOf('FluentDOMIterator', $fdi->getChildren());
 }