File: Issue18Test.php

package info (click to toggle)
php-tokenizer 2.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: php: 552; xml: 417; makefile: 4
file content (20 lines) | stat: -rw-r--r-- 566 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php declare(strict_types = 1);
namespace TheSeer\Tokenizer;

use DOMXPath;
use PHPUnit\Framework\TestCase;

/**
 * @ticket https://github.com/theseer/tokenizer/issues/18
 */
class Issue18Test extends TestCase {
    public function testIssueNoLongerOccurs(): void {
        $result = (new Tokenizer)->parse(file_get_contents(__DIR__ . '/_files/Issue-18.php'));

        $dom = (new XMLSerializer())->toDom($result);

        $node = (new DOMXPath($dom))->query('//*[@no="18"]/*')->item(1);

        $this->assertEquals('{binary data}', $node->textContent);
    }
}