<?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 |
---|---|---|---|---|
Concerns | Folder | 0755 |
|
|
Constraints | Folder | 0755 |
|
|
Exceptions | Folder | 0755 |
|
|
Fluent | Folder | 0755 |
|
|
Assert.php | File | 1.14 KB | 0644 |
|
AssertableJsonString.php | File | 10.44 KB | 0644 |
|
LICENSE.md | File | 1.05 KB | 0644 |
|
LoggedExceptionCollection.php | File | 136 B | 0644 |
|
ParallelConsoleOutput.php | File | 1.36 KB | 0644 |
|
ParallelRunner.php | File | 737 B | 0644 |
|
ParallelTesting.php | File | 6.75 KB | 0644 |
|
ParallelTestingServiceProvider.php | File | 849 B | 0644 |
|
PendingCommand.php | File | 12.89 KB | 0644 |
|
TestComponent.php | File | 3.88 KB | 0644 |
|
TestResponse.php | File | 46.17 KB | 0644 |
|
TestView.php | File | 5.28 KB | 0644 |
|
composer.json | File | 1.37 KB | 0644 |
|