diff --git a/tests/CompilerTest.php b/tests/CompilerTest.php index 4aad5f29..77ff89d1 100644 --- a/tests/CompilerTest.php +++ b/tests/CompilerTest.php @@ -4,6 +4,7 @@ use Doctrine\Common\Annotations\AnnotationReader; use Ray\Aop\Exception\NotWritableException; +use TokenReflection\ReflectionClass; class CompilerTest extends \PHPUnit_Framework_TestCase { @@ -190,9 +191,10 @@ public function testNoNamespace() public function testArrayTypehintedAndCallable() { $class = $this->compiler->compile(FakeArrayTypehinted::class, $this->bind); - $parent = (new \ReflectionClass($class))->getParentClass()->getName(); - $expected = 'Ray\Aop\FakeArrayTypehinted'; - $this->assertSame($expected, $parent); + $file = file((new \ReflectionClass($class))->getFileName()); + $expected = ' function returnSame(array $arrayParam, callable $callableParam) +'; + $this->assertSame($expected, $file[5]); } public function testNotWritable() diff --git a/tests/Fake/FakeAnnotateClassNoName.php b/tests/Fake/FakeAnnotateClassNoName.php index 841d77fa..d372e043 100644 --- a/tests/Fake/FakeAnnotateClassNoName.php +++ b/tests/Fake/FakeAnnotateClassNoName.php @@ -19,4 +19,8 @@ public function getDouble($a) { return $a * 2; } + + public function returnSame($a) + { + } } diff --git a/tests/Fake/FakeArrayTypehinted.php b/tests/Fake/FakeArrayTypehinted.php index 6cbeb97e..335d0f40 100644 --- a/tests/Fake/FakeArrayTypehinted.php +++ b/tests/Fake/FakeArrayTypehinted.php @@ -2,9 +2,9 @@ namespace Ray\Aop; -class FakeArrayTypehinted implements FakeArrayInterface +class FakeArrayTypehinted { - public function invoke(array $array, callable $callable) + public function returnSame(array $arrayParam, callable $callableParam) { } }