1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace Tests\Unit;
- use App\Providers\Macros\ArrayProvider;
- use Illuminate\Support\Arr;
- use Illuminate\Support\Facades\App;
- // use PHPUnit\Framework\TestCase;
- use Tests\TestCase;
- class ArrayMacrosTest extends TestCase
- {
- /**
- * A basic unit test example.
- */
- public function test_array_has_nested_keys(): void
- {
- $array = [
- [
- 'id' => 1,
- 'name' => 'Taras',
- 'age' => 25
- ],
- [
- 'id' => 2,
- 'name' => 'Erlang',
- 'age' => 30
- ]
- ];
- $response = Arr::hasNestedKey('id', $array);
- $this->assertEquals(true, $response);
- }
- }
|