From e7d1a60273744c899de0791c93c89c96ab73ba61 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Mon, 24 Apr 2017 11:03:35 +0200 Subject: [PATCH] Add test case in DefinitionResolverTest for 'define' node --- tests/DefinitionResolverTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/DefinitionResolverTest.php b/tests/DefinitionResolverTest.php index ea0f481..0046ef0 100644 --- a/tests/DefinitionResolverTest.php +++ b/tests/DefinitionResolverTest.php @@ -35,7 +35,7 @@ class DefinitionResolverTest extends TestCase $this->assertInstanceOf(\phpDocumentor\Reflection\Types\Boolean::class, $type); } - public function testGetDefinedFqn() + public function testGetDefinedFqnForIncompleteDefine() { // define('XXX') (only one argument) must not introduce a new symbol $parser = new Parser; @@ -48,4 +48,17 @@ class DefinitionResolverTest extends TestCase $this->assertNull($fqn); } + + public function testGetDefinedFqnForDefine() + { + $parser = new Parser; + $stmts = $parser->parse("setAttribute('ownerDocument', new MockPhpDocument); + + $index = new Index; + $definitionResolver = new DefinitionResolver($index); + $fqn = $definitionResolver->getDefinedFqn($stmts[0]); + + $this->assertEquals('TEST_DEFINE', $fqn); + } }