1 <?php declare(strict_types=1);
5 /* This test is very weak, because PHPUnit's assertEquals assertion is way too slow dealing with the
6 * large objects involved here. So we just do some basic instanceof tests instead. */
7 use PHPUnit\Framework\TestCase;
9 class ParserFactoryTest extends TestCase
11 /** @dataProvider provideTestCreate */
12 public function testCreate($kind, $lexer, $expected) {
13 $this->assertInstanceOf($expected, (new ParserFactory)->create($kind, $lexer));
16 public function provideTestCreate() {
20 ParserFactory::PREFER_PHP7, $lexer,
21 Parser\Multiple::class
24 ParserFactory::PREFER_PHP5, null,
25 Parser\Multiple::class
28 ParserFactory::ONLY_PHP7, null,
32 ParserFactory::ONLY_PHP5, $lexer,