Need advice about which tool to choose?Ask the StackShare community!

Mockito

1.9K
160
+ 1
0
PHPUnit

872
266
+ 1
14
Add tool

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.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Mockito
Pros of PHPUnit
    Be the first to leave a pro
    • 5
      TDD Unit Testing
    • 2
      TDD Integration Testing
    • 2
      Software Quality
    • 2
      TDD Acceptance Testing
    • 1
      TDD Unit Testing
    • 1
      Unit Testing
    • 1
      The de facto standard for xUnit testing in PHP

    Sign up to add or upvote prosMake informed product decisions

    Cons of Mockito
    Cons of PHPUnit
      Be the first to leave a con
      • 1
        Mocked services require more effort and understanding

      Sign up to add or upvote consMake informed product decisions

      What is Mockito?

      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?

      PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.

      Need advice about which tool to choose?Ask the StackShare community!

      Jobs that mention Mockito and PHPUnit as a desired skillset
      CBRE
      United States of America Texas Houston
      CBRE
      United States of America Texas Richardson
      CBRE
      United States of America Texas Richardson
      What companies use Mockito?
      What companies use PHPUnit?
      See which teams inside your own company are using Mockito or PHPUnit.
      Sign up for StackShare EnterpriseLearn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with Mockito?
      What tools integrate with PHPUnit?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      What are some alternatives to Mockito and PHPUnit?
      JUnit
      JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
      Appium
      Appium is an open source test automation framework for use with native, hybrid, and mobile web apps. It drives iOS and Android apps using the WebDriver protocol. Appium is sponsored by Sauce Labs and a thriving community of open source developers.
      Robolectric
      It is a framework that brings fast and reliable unit tests to Android. Tests run inside the JVM on your workstation in seconds. Test drive your Android application with robolectric
      mockk
      It is an open-source library focused on making mocking in Kotlin great. It is a library with the possibility of mocking default arguments, final classes, varargs, coroutines and extension methods.
      xUnit
      It is a free, open source, community-focused unit testing tool for the .NET Framework. It is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. It works with ReSharper, CodeRush, TestDriven.NET and Xamarin.
      See all alternatives