Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 14e18a6

Browse files
committed
documentation
1 parent 8b2f8c4 commit 14e18a6

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

‎README.md‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,40 @@
33
This package integrates the function mock library
44
[PHP-Mock](https://github.com/php-mock/php-mock) with Mockery.
55

6-
# Requirements
7-
86
# Installation
97

8+
Use [Composer](https://getcomposer.org/):
9+
10+
```json
11+
{
12+
"require-dev": {
13+
"php-mock/mockery": "0.1"
14+
}
15+
}
16+
```
17+
1018
# Usage
1119

20+
[`PHPMockery::mock()`](http://php-mock.github.io/mockery/api/class-phpmock.mockery.PHPMockery.html#_mock)
21+
let's you build a function mock which can be equiped
22+
with Mockery's expectations. After your test you'll have to disable all created
23+
function mocks by calling `Mockery::close()`.
24+
25+
## Example
26+
27+
```php
28+
<?php
29+
30+
namespace foo;
31+
32+
use phpmock\mockery\PHPMockery;
33+
34+
$mock = PHPMockery::mock(__NAMESPACE__, "time")->andReturn(3);
35+
assert (3 == time());
36+
37+
\Mockery::close();
38+
```
39+
1240
# License and authors
1341

1442
This project is free and under the WTFPL.

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"require": {
2020
"php": ">=5.4",
2121
"mockery/mockery": "^0.8",
22-
"php-mock/integration": "dev-master"
22+
"php-mock/integration": "^0.2"
2323
},
2424
"minimum-stability": "dev",
2525
"require-dev": {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /