Download the PHP package unit-testing/mockery-helper without Composer
On this page you can find all versions of the php package unit-testing/mockery-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download unit-testing/mockery-helper
More information about unit-testing/mockery-helper
Files in unit-testing/mockery-helper
Download unit-testing/mockery-helper
More information about unit-testing/mockery-helper
Files in unit-testing/mockery-helper
Vendor unit-testing
Package mockery-helper
Short Description a simple trait for convenient implementation of mockery mocks and spies in PHPUnit tests
License MIT
Package mockery-helper
Short Description a simple trait for convenient implementation of mockery mocks and spies in PHPUnit tests
License MIT
Please rate this library. Is it a good library?
Informations about the package mockery-helper
UnitTesting\MockeryHelper
Simple module to help with creating mocks using mockery. You won't have to continually reference Mockery\Mockery
and keep your tests a little DRY'er.
Installation
composer require --dev unit-testing/mockery-helper:dev-master
- or in
require-dev
block ofcomposer.json
, add"unit-testing/mockery-helper": "dev-master"
and then runcomposer update
- don't forget to
require-dev
mockery/mockery
Usage
- In your phpunit test,
use UnitTesting\MockeryHelper\MockeryTrait
. - in your
tearDown()
method call$this->closeMocks()
- When you want to mock something, use
$this->mock()
as an alias forMockery::mock()
- You can also use
$this->spy()
as an alias forMockery::spy()
- Use the result of one of the above function calls as you normally would for your assertions.
mockery
method simply forwards any call to the Mockery static. The first argument is the method, and subsequent arguments are params for the Mockery method.
Example
All versions of mockery-helper with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
The package unit-testing/mockery-helper contains the following files
Loading the files please wait ....