ArrayMacrosTest.php 719 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Tests\Unit;
  3. use App\Providers\Macros\ArrayProvider;
  4. use Illuminate\Support\Arr;
  5. use Illuminate\Support\Facades\App;
  6. // use PHPUnit\Framework\TestCase;
  7. use Tests\TestCase;
  8. class ArrayMacrosTest extends TestCase
  9. {
  10. /**
  11. * A basic unit test example.
  12. */
  13. public function test_array_has_nested_keys(): void
  14. {
  15. $array = [
  16. [
  17. 'id' => 1,
  18. 'name' => 'Taras',
  19. 'age' => 25
  20. ],
  21. [
  22. 'id' => 2,
  23. 'name' => 'Erlang',
  24. 'age' => 30
  25. ]
  26. ];
  27. $response = Arr::hasNestedKey('id', $array);
  28. $this->assertEquals(true, $response);
  29. }
  30. }