🔧
This commit is contained in:
10
vendor/hamcrest/hamcrest-php/README.md
vendored
10
vendor/hamcrest/hamcrest-php/README.md
vendored
@@ -1,7 +1,7 @@
|
||||
This is the PHP port of Hamcrest Matchers
|
||||
=========================================
|
||||
|
||||
[](https://travis-ci.org/hamcrest/hamcrest-php)
|
||||
[](https://github.com/hamcrest/hamcrest-php/actions/workflows/tests.yml)
|
||||
|
||||
Hamcrest is a matching library originally written for Java, but
|
||||
subsequently ported to many other languages. hamcrest-php is the
|
||||
@@ -133,7 +133,7 @@ assertThat(['name'=> 'foobar'], hasKeyInArray('name'));
|
||||
|
||||
* `hasKey` - alias of hasKeyInArray
|
||||
|
||||
* `hasKeyValuePair` - check if arary has given key, value pair
|
||||
* `hasKeyValuePair` - check if array has given key, value pair
|
||||
```php
|
||||
assertThat(['name'=> 'foobar'], hasKeyValuePair('name', 'foobar'));
|
||||
```
|
||||
@@ -143,7 +143,7 @@ assertThat(['name'=> 'foobar'], hasKeyValuePair('name', 'foobar'));
|
||||
```php
|
||||
assertthat([2, 4, 6], arrayWithSize(3));
|
||||
```
|
||||
* `emptyArray` - check if array is emtpy
|
||||
* `emptyArray` - check if array is empty
|
||||
```php
|
||||
assertThat([], emptyArray());
|
||||
```
|
||||
@@ -222,7 +222,7 @@ assertThat([2, 4, 6], everyItem(notNullValue()));
|
||||
assertThat([2, 4, 6], hasItem(equalTo(2)));
|
||||
```
|
||||
|
||||
* `hasItems` - check array has givem items, it can take multiple matcher as arguments
|
||||
* `hasItems` - check array has given items, it can take multiple matcher as arguments
|
||||
```php
|
||||
assertThat([1, 3, 5], hasItems(equalTo(1), equalTo(3)));
|
||||
```
|
||||
@@ -456,7 +456,7 @@ $fp = fopen("/tmp/foo", "w+");
|
||||
assertThat($fp, resourceValue());
|
||||
```
|
||||
|
||||
* `scalarValue` - check for scaler value
|
||||
* `scalarValue` - check for scalar value
|
||||
```php
|
||||
assertThat(1, scalarValue());
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user