Phake is a framework for PHP that aims to provide mock objects, test doubles and method stubs.

Phake was inspired by a lack of flexibility and ease of use in the current mocking frameworks combined with a recent experience with Mockito for Java.

A key conceptual difference in mocking between Phake and most of php mocking frameworks (ie: mock functionality in PHPUnit, PHPMock, and mock functionality in SimpleTest) is that Phake (like Mockito) employs a verification strategy to ensure that calls get made. That is to say, you call your code as normal and then after you have finished the code being tested you can verify whether or not expected methods were called. This is very different from the aforementioned products for php which use an expectation strategy where you lay out your expectations prior to any calls being made.

Code Quality Rank: L5
Monthly Downloads: 47,150
Programming language: PHP
License: BSD 3-clause "New" or "Revised" License
Tags: Testing     Mock    

Phake alternatives and related libraries

Based on the "Testing" category

Do you think we are missing an alternative of Phake or a related project?

Add another 'Testing' Library

Phake Recommendations

There are no recommendations yet. Be the first to promote Phake!

Have you used Phake? Share your experience. Write a short recommendation and Phake, you and your project will be promoted on Awesome PHP.
Recommend Phake

Recently added Phake resources

Do you know of a useful tutorial, book or news relevant to Phake?
Be the first to add one!