/** * @group CoreFunctions * @covers FluentDOMCore::spawn */ public function testSpawnWithElements() { $dom = new DOMDocument(); $node = $dom->createElement('test'); $dom->appendChild($node); $fdParent = new FluentDOMCore(); $fdParent->load($dom); $fdChild = $fdParent->spawn($node); $this->assertAttributeSame(array($node), '_array', $fdChild); }
/** * Get children of the current iterator element * * @return object FluentDOMCore */ public function getChildren() { $fd = $this->_owner->spawn(); $fd->push($this->_owner->item($this->_position)->childNodes); return new self($fd); }
/** * @group CoreFunctions * @covers FluentDOMCore::spawn */ public function testSpawn() { $fdParent = new FluentDOMCore(); $fdChild = $fdParent->spawn(); $this->assertAttributeSame($fdParent, '_parent', $fdChild); }