ParserFactoryTest.php 621 B

1234567891011121314151617
  1. <?php declare(strict_types=1);
  2. namespace PhpParser;
  3. /* This test is very weak, because PHPUnit's assertEquals assertion is way too slow dealing with the
  4. * large objects involved here. So we just do some basic instanceof tests instead. */
  5. use PhpParser\Parser\Php7;
  6. use PhpParser\Parser\Php8;
  7. class ParserFactoryTest extends \PHPUnit\Framework\TestCase {
  8. public function testCreate(): void {
  9. $factory = new ParserFactory();
  10. $this->assertInstanceOf(Php8::class, $factory->createForNewestSupportedVersion());
  11. $this->assertInstanceOf(Parser::class, $factory->createForHostVersion());
  12. }
  13. }