TokenizerTest.php 565B

12345678910111213141516171819202122
  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. }