|
2 | 2 |
|
3 | 3 | Provides helper traits for PHPUnit.
|
4 | 4 |
|
| 5 | +- [TestDouble](#testdouble) ... Easy mock creation |
| 6 | +- [ReflectionHelper](#reflectionhelper) ... Easy private property/method testing |
| 7 | + |
| 8 | +## Table of Contents |
| 9 | + |
| 10 | +* [Installation](#installation) |
| 11 | +* [Usage](#usage) |
| 12 | + * [TestDouble](#testdouble) |
| 13 | + * [$this->getDouble()](#this-getdouble) |
| 14 | + * [$this->verifyInvoked()](#this-verifyinvoked) |
| 15 | + * [$this->verifyInvokedOnce()](#this-verifyinvokedonce) |
| 16 | + * [$this->verifyInvokedMultipleTimes()](#this-verifyinvokedmultipletimes) |
| 17 | + * [$this->verifyNeverInvoked()](#this-verifyneverinvoked) |
| 18 | + * [ReflectionHelper](#reflectionhelper) |
| 19 | + * [$this->getPrivateProperty()](#this-getprivateproperty) |
| 20 | + * [$this->setPrivateProperty()](#this-setprivateproperty) |
| 21 | + * [$this->getPrivateMethodInvoker()](#this-getprivatemethodinvoker) |
| 22 | +* [License](#license) |
| 23 | + |
5 | 24 | ## Installation
|
6 | 25 |
|
7 |
| -Run |
| 26 | +Run: |
8 | 27 |
|
9 |
| -```sh |
| 28 | +```sh-session |
10 | 29 | $ composer require --dev kenjis/phpunit-helper
|
11 | 30 | ```
|
12 | 31 |
|
13 | 32 | ## Usage
|
14 | 33 |
|
15 |
| -- [TestDouble](#testdouble) ... Easy mock creation |
16 |
| -- [ReflectionHelper](#reflectionhelper) ... Easy private property/method testing |
17 |
| - |
18 | 34 | ### `TestDouble`
|
19 | 35 |
|
20 | 36 | This trait provides helper methods to create mock objects and to verify invocations.
|
@@ -131,7 +147,7 @@ $this->verifyInvoked(
|
131 | 147 | $loader,
|
132 | 148 | 'view',
|
133 | 149 | [
|
134 |
| - 'shopConfirm', $this->anything(), TRUE |
| 150 | + 'shopConfirm', $this->anything(), true |
135 | 151 | ]
|
136 | 152 | );
|
137 | 153 | ```
|
@@ -312,3 +328,9 @@ $this->assertEquals(
|
312 | 328 | 'return value of the privateMethod() method', $method()
|
313 | 329 | );
|
314 | 330 | ~~~
|
| 331 | + |
| 332 | +## License |
| 333 | + |
| 334 | +This package is licensed using the MIT License. |
| 335 | + |
| 336 | +Please have a look at [`LICENSE`](LICENSE). |
0 commit comments