<?php /* * This file is part of Psy Shell. * * (c) 2012-2023 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Psy\Test; use PhpParser\ParserFactory as OriginalParserFactory; use Psy\ParserFactory; class ParserFactoryTest extends \PHPUnit\Framework\TestCase { public function testGetPossibleKinds() { $kinds = ParserFactory::getPossibleKinds(); $this->assertContains(ParserFactory::PREFER_PHP7, $kinds); foreach ($kinds as $kind) { $this->assertTrue(\defined("Psy\\ParserFactory::$kind")); } } public function testGetDefaultKind() { $factory = new ParserFactory(); if (!\class_exists(OriginalParserFactory::class)) { $this->assertNull($factory->getDefaultKind()); return; } $this->assertSame(ParserFactory::ONLY_PHP7, $factory->getDefaultKind()); } public function testCreateParser() { $factory = new ParserFactory(); $parser = $factory->createParser(); $this->assertInstanceOf(\PhpParser\Parser\Php7::class, $parser); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
CodeCleaner | Folder | 0755 |
|
|
Command | Folder | 0755 |
|
|
Exception | Folder | 0755 |
|
|
Formatter | Folder | 0755 |
|
|
Input | Folder | 0755 |
|
|
Readline | Folder | 0755 |
|
|
Reflection | Folder | 0755 |
|
|
Sudo | Folder | 0755 |
|
|
TabCompletion | Folder | 0755 |
|
|
Util | Folder | 0755 |
|
|
VersionUpdater | Folder | 0755 |
|
|
fixtures | Folder | 0755 |
|
|
tools | Folder | 0755 |
|
|
ClassWithSecretConstructor.php | File | 507 B | 0644 |
|
ClassWithSecretParentConstructor.php | File | 358 B | 0644 |
|
ClassWithSecretiveParent.php | File | 340 B | 0644 |
|
ClassWithSecrets.php | File | 928 B | 0644 |
|
CodeCleanerTest.php | File | 3.26 KB | 0644 |
|
ConfigPathsTest.php | File | 7.08 KB | 0644 |
|
ConfigurationTest.php | File | 21.81 KB | 0644 |
|
ContextTest.php | File | 9.57 KB | 0644 |
|
FakeShell.php | File | 582 B | 0644 |
|
ParserFactoryTest.php | File | 1.22 KB | 0644 |
|
ParserTestCase.php | File | 2.51 KB | 0644 |
|
ShellTest.php | File | 20.03 KB | 0644 |
|
SudoTest.php | File | 5.49 KB | 0644 |
|
TestCase.php | File | 3.15 KB | 0644 |
|
TestableEnv.php | File | 560 B | 0644 |
|