File: InstructionProcessorMock.php

package info (click to toggle)
php-masterminds-html5 2.7.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 736 kB
  • sloc: php: 9,565; makefile: 19
file content (26 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace Masterminds\HTML5\Tests\Parser;

class InstructionProcessorMock implements \Masterminds\HTML5\InstructionProcessor
{
    public $name = null;

    public $data = null;

    public $count = 0;

    public function process(\DOMElement $element, $name, $data)
    {
        $this->name = $name;
        $this->data = $data;
        ++$this->count;

        $div = $element->ownerDocument->createElement('div');
        $div->nodeValue = 'foo';

        $element->appendChild($div);

        return $div;
    }
}