Skip to content

Commit

Permalink
Merge pull request #11 from smartbooster/add_array_contains_value
Browse files Browse the repository at this point in the history
Add assertArrayContainsValues
  • Loading branch information
mathieu-ducrot authored Jan 8, 2024
2 parents 79b2115 + a556270 commit 60177a5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CHANGELOG for 1.x
===================
## v1.0.2 - (2024-01-08)

### Added

- `AbstractWebTestCase::assertArrayContainsValues` : Test if an array contains exactly all values of an array of values, no matter there order

## v1.0.1 - (2024-01-04)

### Fix

- Fix passing format 1G to phpstan memory-limit option
12 changes: 12 additions & 0 deletions src/AbstractWebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,16 @@ protected static function getMethod(string $name, string $class): \ReflectionMet

return $method;
}

/**
* Test if $array contains exactly all values of $values no matter there order
*/
public function assertArrayContainsValues(array $values, array $array): void
{
$this->assertCount(count($values), $array);

foreach ($values as $value) {
$this->assertContains($value, $array);
}
}
}

0 comments on commit 60177a5

Please sign in to comment.