Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/phake/phake

PHP Mocking Framework
https://github.com/phake/phake

framework mock php phpunit spy stub test-doubles testing

Last synced: about 15 hours ago
JSON representation

PHP Mocking Framework

Awesome Lists containing this project

README

        

Phake
=======
[![Tests](https://github.com/phake/phake/actions/workflows/tests.yml/badge.svg)](https://github.com/phake/phake/actions/workflows/tests.yml)
[![Latest Stable Version](https://poser.pugx.org/phake/phake/v/stable.png)](https://packagist.org/packages/phake/phake)
[![Total Downloads](https://poser.pugx.org/phake/phake/downloads.png)](https://packagist.org/packages/phake/phake)
[![License](https://poser.pugx.org/phake/phake/license.png)](https://packagist.org/packages/phake/phake)

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.

Installation - Composer
-----------------------

Phake can be installed using [Composer](https://github.com/composer/composer).

```
composer require --dev phake/phake
```

Installation - Source
---------------------

You can also of course install it from source by downloading it from our github repository: https://github.com/phake/phake

Links
-------------

There are a few links that have information on how you can utilize Phake.

* [Phake Website](https://phake.github.io)
* [Phake Documentation](https://phake.github.io/doc/)
* [Initial Phake Announcement](https://web.archive.org/web/20101230174850/http://digitalsandwich.com/archives/84-introducing-phake-mocking-framework.html)
* [PHPStorm Plugin](https://plugins.jetbrains.com/plugin/17261-phake)

If you have an article or tutorial that you would like to share, feel free to open an [issue](https://github.com/phake/phake/issues) on github and I will add it to this list