Need advice about which tool to choose?Ask the StackShare community!
Mockito vs PHPUnit: What are the differences?
What is Mockito? Tasty mocking framework for unit tests in Java. It is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. It doesn’t give you hangover because the tests are very readable and they produce clean verification errors.
What is PHPUnit? Testing framework for PHP. PHPUnit is a programmer-oriented testing framework for PHP It is an instance of the xUnit architecture for unit testing frameworks..
Mockito and PHPUnit can be categorized as "Testing Frameworks" tools.
Mockito and PHPUnit are both open source tools. It seems that PHPUnit with 14.3K GitHub stars and 1.75K forks on GitHub has more adoption than Mockito with 9.02K GitHub stars and 1.62K GitHub forks.
Geocodio, Index.co, and Clippings are some of the popular companies that use PHPUnit, whereas Mockito is used by Frichti, Mercedes-Benz.io GmbH, and Debut. PHPUnit has a broader approval, being mentioned in 43 company stacks & 31 developers stacks; compared to Mockito, which is listed in 9 company stacks and 6 developer stacks.
Pros of Mockito
Pros of PHPUnit
- TDD Unit Testing5
- TDD Integration Testing2
- Software Quality2
- TDD Acceptance Testing2
- TDD Unit Testing1
- Unit Testing1
- The de facto standard for xUnit testing in PHP1
Sign up to add or upvote prosMake informed product decisions
Cons of Mockito
Cons of PHPUnit
- Mocked services require more effort and understanding1