TokenizerTest.php 565 B

123456789101112131415161718192021
  1. <?php declare(strict_types = 1);
  2. namespace TheSeer\Tokenizer;
  3. use PHPUnit\Framework\TestCase;
  4. /**
  5. * @covers \TheSeer\Tokenizer\Tokenizer
  6. */
  7. class TokenizerTest extends TestCase {
  8. public function testValidSourceGetsParsed() {
  9. $tokenizer = new Tokenizer();
  10. $result = $tokenizer->parse(file_get_contents(__DIR__ . '/_files/test.php'));
  11. $expected = unserialize(
  12. file_get_contents(__DIR__ . '/_files/test.php.tokens'),
  13. [TokenCollection::class]
  14. );
  15. $this->assertEquals($expected, $result);
  16. }
  17. }