Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
64
vendor/psy/psysh/test/Reflection/ReflectionLanguageConstructParameterTest.php
vendored
Normal file
64
vendor/psy/psysh/test/Reflection/ReflectionLanguageConstructParameterTest.php
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Psy Shell.
|
||||
*
|
||||
* (c) 2012-2018 Justin Hileman
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Psy\Test\Reflection;
|
||||
|
||||
use Psy\Reflection\ReflectionLanguageConstruct;
|
||||
use Psy\Reflection\ReflectionLanguageConstructParameter;
|
||||
|
||||
class ReflectionLanguageConstructParameterTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testOptions()
|
||||
{
|
||||
$keyword = new ReflectionLanguageConstruct('die');
|
||||
|
||||
$refl = new ReflectionLanguageConstructParameter($keyword, 'one', [
|
||||
'isArray' => false,
|
||||
'defaultValue' => null,
|
||||
'isOptional' => false,
|
||||
'isPassedByReference' => false,
|
||||
]);
|
||||
|
||||
$this->assertNull($refl->getClass());
|
||||
$this->assertEquals('one', $refl->getName());
|
||||
$this->assertFalse($refl->isArray());
|
||||
$this->assertTrue($refl->isDefaultValueAvailable());
|
||||
$this->assertNull($refl->getDefaultValue());
|
||||
$this->assertFalse($refl->isOptional());
|
||||
$this->assertFalse($refl->isPassedByReference());
|
||||
|
||||
$reflTwo = new ReflectionLanguageConstructParameter($keyword, 'two', [
|
||||
'isArray' => true,
|
||||
'isOptional' => true,
|
||||
'isPassedByReference' => true,
|
||||
]);
|
||||
|
||||
$this->assertNull($refl->getClass());
|
||||
$this->assertEquals('two', $reflTwo->getName());
|
||||
$this->assertTrue($reflTwo->isArray());
|
||||
$this->assertFalse($reflTwo->isDefaultValueAvailable());
|
||||
$this->assertNull($reflTwo->getDefaultValue());
|
||||
$this->assertTrue($reflTwo->isOptional());
|
||||
$this->assertTrue($reflTwo->isPassedByReference());
|
||||
|
||||
$refl = new ReflectionLanguageConstructParameter($keyword, 'three', [
|
||||
'defaultValue' => 3,
|
||||
]);
|
||||
|
||||
$this->assertNull($refl->getClass());
|
||||
$this->assertEquals('three', $refl->getName());
|
||||
$this->assertFalse($refl->isArray());
|
||||
$this->assertTrue($refl->isDefaultValueAvailable());
|
||||
$this->assertEquals(3, $refl->getDefaultValue());
|
||||
$this->assertFalse($refl->isOptional());
|
||||
$this->assertFalse($refl->isPassedByReference());
|
||||
}
|
||||
}
|
Reference in a new issue