This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -1,7 +1,7 @@
This is the PHP port of Hamcrest Matchers
=========================================
[![Build Status](https://travis-ci.org/hamcrest/hamcrest-php.png?branch=master)](https://travis-ci.org/hamcrest/hamcrest-php)
[![tests](https://github.com/hamcrest/hamcrest-php/actions/workflows/tests.yml/badge.svg)](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());
```