Skip to content

Commit 1a261db

Browse files
committed
Cleanup README a little more
1 parent 7a25674 commit 1a261db

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ Tired of spending most of your testing time mocking objects like there's no tomo
1212

1313
## Installation
1414

15-
You can simply install the package via composer:
15+
You can install the package via composer:
1616

1717
```bash
1818
composer require --dev facile-it/moka
1919
```
2020

2121
## Usage
2222

23-
To use **Moka** in your tests simply `use` function `Moka\Plugin\PHPUnit\moka()` (see generators section [below](#strategies)) and run `Moka::clean()` before every test. A simple interface will let you create *moka* (mock) objects and decorate them with *stub* methods with a fluent interface.
24-
25-
A complete example follows:
23+
To use **Moka** in your tests simply `use` function `Moka\Plugin\PHPUnit\moka()` (see generators section [below](#strategies)) and run `Moka::clean()` before every test. A simple interface will let you create *moka* (mock) objects and decorate them with *stub* methods via a fluent interface:
2624

2725
```php
2826
<?php
@@ -131,7 +129,7 @@ var_dump($mock1 === $mock2);
131129

132130
### `ProxyInterface::stub(array $methodsWithValues): ProxyInterface`
133131

134-
Accepts an array of method stubs with format `[$methodName => $methodValue]`, where `$methodName` **must** be a string and `$methodValue` can be of any type, including another mock object or an exception instance:
132+
Accepts an array of method stubs with format `[$methodName => $methodValue]`, where `$methodName` **must** be a string and `$methodValue` can be of any type, including another mock object or an exception instance (which will be thrown):
135133

136134
```php
137135
$mock = moka(BarInterface::class)->stub([
@@ -144,7 +142,7 @@ var_dump($mock->isValid());
144142
// bool(true)
145143
```
146144

147-
**Notice:** the stub is valid for **any** invocation of the method and it cannot be overridden.
145+
**Notice:** the stub is valid for **any** invocation of the method and cannot be overridden.
148146
If you need more granular control over invocation strategies, you can get [access to the original mock object implementation](#original-mock).
149147

150148
## <a name='strategies'></a>Supported mock object generators

0 commit comments

Comments
 (0)