redhead/mockyll

Mocking library for PHP (>= 5.4).

Installs: 7

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/redhead/mockyll

dev-master 2013-09-15 20:12 UTC

This package is not auto-updated.

Last update: 2025-10-06 20:14:39 UTC


README

Nice and simple mocking library for PHP based on GMock for Groovy.

It offers:

  • simple usage
  • no complicated setup
  • class and interface mocking based on inheritance
  • partial mocks

Install

Install the library using composer:

$ composer require redhead/mockyll:@dev

That's it!

Simple usage

$mockController = new Mockyll\MockController;

$myClassMock = $mockController->mock('MyClass');
$myClassMock->greet('world')->returns('hello world!');

$mockController->play(function() use ($myClassMock) {
  $myClassMock->greet('world'); // == 'hello world!'
}