| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /**
- * Test: Nette\Utils\Arrays::searchKey()
- */
- declare(strict_types=1);
- use Nette\Utils\Arrays;
- use Tester\Assert;
- require __DIR__ . '/../bootstrap.php';
- Assert::same(
- [
- 'first' => null,
- 'a' => 'second',
- 'd' => ['third'],
- 'fourth' => null,
- ],
- Arrays::normalize([
- 1 => 'first',
- 'a' => 'second',
- 'd' => ['third'],
- 7 => 'fourth',
- ]),
- );
- Assert::same(
- [
- 'first' => true,
- '' => 'second',
- ],
- Arrays::normalize([
- 1 => 'first',
- '' => 'second',
- ], filling: true),
- );
|