Skip to content

Commit 201abf8

Browse files
samnelanorberttech
authored andcommitted
Fixed PHPUnit integration section (coduo#138)
1 parent 377d358 commit 201abf8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# PHP Matcher
22

3-
Library created for testing all kinds of JSON/XML/TXT/Scalar values against patterns.
3+
Library created for testing all kinds of JSON/XML/TXT/Scalar values against patterns.
44

55
```php
66
PHPMatcher::match($value = '{"foo": "bar"}', $pattern = '{"foo": "@string@"}');
77
```
88

9-
It was built to simplify API's functional testing.
9+
It was built to simplify API's functional testing.
1010

1111
* [![Build Status](https://travis-ci.org/coduo/php-matcher.svg)](https://travis-ci.org/coduo/php-matcher) - master (3.2.*)
1212
* [![Build Status](https://travis-ci.org/coduo/php-matcher.svg?branch=3.1)](https://travis-ci.org/coduo/php-matcher) - 3.1.*
1313

1414
[Readme for master (3.2) version](https://github.com/coduo/php-matcher/tree/master/README.md)
15-
[Readme for 3.1 version](https://github.com/coduo/php-matcher/tree/3.1/README.md)
15+
[Readme for 3.1 version](https://github.com/coduo/php-matcher/tree/3.1/README.md)
1616

1717

1818
## Installation
@@ -32,7 +32,7 @@ composer require --dev "coduo/php-matcher"
3232

3333
use Coduo\PHPMatcher\PHPMatcher;
3434

35-
if (!PHPMatcher::match("lorem ipsum dolor", "@string@", $error)) {
35+
if (!PHPMatcher::match("lorem ipsum dolor", "@string@", $error)) {
3636
echo $error; // in case of error message is set on $error variable via reference
3737
}
3838

@@ -214,7 +214,7 @@ $matcher->match(array("bar"), "@wildcard@");
214214
$matcher->match(new \stdClass, "@wildcard@");
215215
```
216216

217-
### Expression matching
217+
### Expression matching
218218

219219
```php
220220
<?php
@@ -241,7 +241,7 @@ $matcher = $factory->createMatcher();
241241
$matcher->match('9f4db639-0e87-4367-9beb-d64e3f42ae18', '@uuid@');
242242
```
243243

244-
### Array matching
244+
### Array matching
245245

246246
```php
247247
<?php
@@ -296,11 +296,11 @@ $matcher->match(
296296
),
297297
'@boolean@',
298298
'@double@'
299-
)
299+
)
300300
);
301301
```
302302

303-
### Json matching
303+
### Json matching
304304

305305
```php
306306
<?php
@@ -452,7 +452,7 @@ Feature: Listing user toys
452452
Scenario: Listing toys
453453
Given the following users exist:
454454
| firstName | lastName |
455-
| Chuck | Norris |
455+
| Chuck | Norris |
456456
457457
And the following toys user "Chuck Norris" exist:
458458
| name |
@@ -483,7 +483,7 @@ Feature: Listing user toys
483483
}
484484
]
485485
"""
486-
```
486+
```
487487

488488
## PHPUnit integration
489489

@@ -495,8 +495,9 @@ or extend the `Coduo\PHPMatcher\PHPUnit\PHPMatcherTestCase`:
495495
namespace Coduo\PHPMatcher\Tests\PHPUnit;
496496

497497
use Coduo\PHPMatcher\PHPUnit\PHPMatcherAssertions;
498+
use PHPUnit\Framework\TestCase;
498499

499-
class PHPMatcherAssertionsTest extends \PHPUnit_Framework_TestCase
500+
class PHPMatcherAssertionsTest extends TestCase
500501
{
501502
use PHPMatcherAssertions;
502503

@@ -510,7 +511,7 @@ class PHPMatcherAssertionsTest extends \PHPUnit_Framework_TestCase
510511
The `matchesPattern()` method can be used in PHPUnit stubs or mocks:
511512

512513
```php
513-
$mock = $this->getMock(Foo::class);
514+
$mock = $this->createMock(Foo::class);
514515
$mock->method('bar')
515516
->with($this->matchesPattern('@string@'))
516517
->willReturn('foo');
@@ -524,4 +525,3 @@ This library is distributed under the MIT license. Please see the LICENSE file.
524525

525526
This lib was inspired by [JSON Expressions gem](https://github.com/chancancode/json_expressions) &&
526527
[Behat RestExtension ](https://github.com/jakzal/RestExtension)
527-

0 commit comments

Comments
 (0)