redhead / mockyll
Mocking library for PHP (>= 5.4).
dev-master
2013-09-15 20:12 UTC
Requires
- nette/tester: @dev
This package is not auto-updated.
Last update: 2025-03-24 17:22:14 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!' }