laminas / laminas-cli

Console command runner, exposing commands written in Laminas MVC and Mezzio components and applications
https://docs.laminas.dev/laminas-cli
BSD 3-Clause "New" or "Revised" License
55 stars 23 forks source link

Replace usage of prophecy with native PHPUnit mock objects #41

Closed weierophinney closed 4 years ago

weierophinney commented 4 years ago

Feature Request

Q A
New Feature no
RFC no
BC Break no

Summary

Following on from #27 / #39, we should move from usage of prophecy for mocking objects to PHPUnit's native mocking library.

One thing I noted in getting the test cases to work with psalm is that I essentially had to suppress static analysis whenever configuring a Prophecy mock, as the return types could not be inferred, and usage of features like Argument::* meant that arguments passed to methods were flagged as invalid.

Since PHPUnit's mocking library only ever invokes its own methods, it plays nicer with psalm, as the arguments and return values are well-documented.