hasConst() public méthode

public hasConst ( string $name, boolean $inherit = false ) : boolean
$name string
$inherit boolean
Résultat boolean
 public function testHasConstWithParent()
 {
     $reflection = new ReflectionClass(Parameter::class);
     $definition = new RuntimeClassDefinition($reflection);
     static::assertFalse($definition->hasConst('BRANCH_ROOT'));
     static::assertTrue($definition->hasConst('BRANCH_ROOT', true));
 }
 public function testHasConst()
 {
     $reflection = new ReflectionClass('PHPSA\\Context');
     $definition = new RuntimeClassDefinition($reflection);
     foreach ($reflection->getConstants() as $constant) {
         static::assertTrue($definition->hasConst($constant));
     }
     static::assertFalse($definition->hasConst('XXXXXXXXX'));
 }