Skip to content

Commit

Permalink
Fix the class attached to methodnotfoundexception
Browse files Browse the repository at this point in the history
The class was always being set to ObjectProphecy, which causes issues when trying to work out which class the method was not found on

An alternative would have been to use $this->getProphecy()->reveal() but that may cause side effects
  • Loading branch information
Ciaran McNulty authored and ciaranmcnulty committed Dec 10, 2020
1 parent 3b8a14d commit f4caf05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function apply(ClassNode $node)
$__call->setCode(<<<PHP
throw new \Prophecy\Exception\Doubler\MethodNotFoundException(
sprintf('Method `%s::%s()` not found.', get_class(\$this), func_get_arg(0)),
\$this->getProphecy(), func_get_arg(0)
get_class(\$this), func_get_arg(0)
);
PHP
);
Expand Down

0 comments on commit f4caf05

Please sign in to comment.