diff --git a/fixtures/WithPhpdocClass.php b/fixtures/WithPhpdocClass.php new file mode 100644 index 000000000..3f42c3c42 --- /dev/null +++ b/fixtures/WithPhpdocClass.php @@ -0,0 +1,17 @@ +contextFactory->createFromReflector($reflectionClass) ); - return $phpdoc->getTagsByName('method'); + $methods = array(); + + foreach ($phpdoc->getTagsByName('method') as $tag) { + if ($tag instanceof Method) { + $methods[] = $tag; + } + } + + return $methods; } catch (\InvalidArgumentException $e) { return array(); } diff --git a/tests/Doubler/ClassPatch/MagicCallPatchTest.php b/tests/Doubler/ClassPatch/MagicCallPatchTest.php new file mode 100644 index 000000000..2535d9911 --- /dev/null +++ b/tests/Doubler/ClassPatch/MagicCallPatchTest.php @@ -0,0 +1,27 @@ +reflect($class, array()); + + $patch = new MagicCallPatch(); + + $patch->apply($classNode); + + $this->assertTrue($classNode->hasMethod('name')); + } +}