|
5 | 5 | namespace Syntatis\Utils\Tests; |
6 | 6 |
|
7 | 7 | use Error; |
| 8 | +use League\Uri\Http; |
8 | 9 | use PHPUnit\Framework\Attributes\DataProvider; |
9 | 10 | use PHPUnit\Framework\Attributes\TestDox; |
10 | 11 | use PHPUnit\Framework\TestCase; |
@@ -347,6 +348,7 @@ public static function dataIsEmailInvalid(): array |
347 | 348 | public static function dataIsURLValid(): array |
348 | 349 | { |
349 | 350 | return [ |
| 351 | + [Http::createFromString('http://www.example.com')], |
350 | 352 | ['http://a.pl'], |
351 | 353 | ['http://www.example.com'], |
352 | 354 | ['http://tt.example.com'], |
@@ -733,13 +735,39 @@ public static function dataIsUniqueOptionFields(): array |
733 | 735 | ], |
734 | 736 | ['latitude', 'longitude'], |
735 | 737 | ], |
| 738 | + [ |
| 739 | + [ |
| 740 | + [ |
| 741 | + 'label' => 'foo', |
| 742 | + 'latitude' => '3', |
| 743 | + 'longitude' => '2', |
| 744 | + ], |
| 745 | + [ |
| 746 | + 'label' => 'bar', |
| 747 | + 'latitude' => '3', |
| 748 | + ], |
| 749 | + ], |
| 750 | + ['latitude', 'longitude'], |
| 751 | + ], |
| 752 | + [ |
| 753 | + [ |
| 754 | + [ |
| 755 | + 'label' => 'foo', |
| 756 | + 'latitude' => '3', |
| 757 | + 'longitude' => '2', |
| 758 | + ], |
| 759 | + ['label' => 'bar'], |
| 760 | + ], |
| 761 | + ['latitude', 'longitude'], |
| 762 | + ], |
736 | 763 | ]; |
737 | 764 | } |
738 | 765 |
|
739 | 766 | public static function dataIsNotUnique(): array |
740 | 767 | { |
741 | 768 | return [ |
742 | 769 | 'empty' => [[]], |
| 770 | + 'non-array' => ['string'], |
743 | 771 | 'sequential' => [[1, 2, 2]], // index 1 and 2 are not unique. |
744 | 772 | 'associative' => [['a' => 1, 'b' => 2, 'c' => 2]], // b and c are not unique. |
745 | 773 | 'multidimensional' => [['a' => 1, 'b' => [1, 2], 'c' => [1, 2]]], // b and c are not unique. |
|
0 commit comments