InstructionProcessorMock.php 526 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Masterminds\HTML5\Tests\Parser;
  3. class InstructionProcessorMock implements \Masterminds\HTML5\InstructionProcessor
  4. {
  5. public $name = null;
  6. public $data = null;
  7. public $count = 0;
  8. public function process(\DOMElement $element, $name, $data)
  9. {
  10. $this->name = $name;
  11. $this->data = $data;
  12. ++$this->count;
  13. $div = $element->ownerDocument->createElement('div');
  14. $div->nodeValue = 'foo';
  15. $element->appendChild($div);
  16. return $div;
  17. }
  18. }