<?php namespace Illuminate\Testing; use ArrayAccess; use Illuminate\Testing\Constraints\ArraySubset; use Illuminate\Testing\Exceptions\InvalidArgumentException; use PHPUnit\Framework\Assert as PHPUnit; /** * @internal This class is not meant to be used or overwritten outside the framework itself. */ abstract class Assert extends PHPUnit { /** * Asserts that an array has a specified subset. * * @param \ArrayAccess|array $subset * @param \ArrayAccess|array $array * @param bool $checkForIdentity * @param string $msg * @return void */ public static function assertArraySubset($subset, $array, bool $checkForIdentity = false, string $msg = ''): void { if (! (is_array($subset) || $subset instanceof ArrayAccess)) { throw InvalidArgumentException::create(1, 'array or ArrayAccess'); } if (! (is_array($array) || $array instanceof ArrayAccess)) { throw InvalidArgumentException::create(2, 'array or ArrayAccess'); } $constraint = new ArraySubset($subset, $checkForIdentity); PHPUnit::assertThat($array, $constraint, $msg); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.github | Folder | 0755 |
|
|
Concerns | Folder | 0755 |
|
|
Constraints | Folder | 0755 |
|
|
Exceptions | Folder | 0755 |
|
|
Fluent | Folder | 0755 |
|
|
.gitattributes | File | 54 B | 0644 |
|
Assert.php | File | 1.18 KB | 0644 |
|
AssertableJsonString.php | File | 10.84 KB | 0644 |
|
LICENSE.md | File | 1.07 KB | 0644 |
|
LoggedExceptionCollection.php | File | 146 B | 0644 |
|
ParallelConsoleOutput.php | File | 1.42 KB | 0644 |
|
ParallelRunner.php | File | 774 B | 0644 |
|
ParallelTesting.php | File | 7.03 KB | 0644 |
|
ParallelTestingServiceProvider.php | File | 887 B | 0644 |
|
PendingCommand.php | File | 13.36 KB | 0644 |
|
TestComponent.php | File | 4.04 KB | 0644 |
|
TestResponse.php | File | 47.89 KB | 0644 |
|
TestView.php | File | 5.49 KB | 0644 |
|
composer.json | File | 1.41 KB | 0644 |
|