gossi\codegen\tests\parser\ClassParserTest::testClassWithConstants PHP Method

testClassWithConstants() public method

    public function testClassWithConstants()
    {
        $class = PhpClass::fromFile(__DIR__ . '/../fixtures/ClassWithConstants.php');
        $this->assertTrue($class->hasConstant('FOO'));
        $this->assertEquals('bar', $class->getConstant('FOO')->getValue());
        $this->assertTrue($class->hasConstant('NMBR'));
        $this->assertEquals(300, $class->getConstant('NMBR')->getValue());
        $this->assertTrue($class->hasConstant('BAR'));
        $this->assertEquals('self::FOO', $class->getConstant('BAR')->getExpression());
    }