Skip to content

Commit f75475c

Browse files
committed
Update Val tests data
1 parent 37e8179 commit f75475c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/app/ValTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Syntatis\Utils\Tests;
66

77
use Error;
8+
use League\Uri\Http;
89
use PHPUnit\Framework\Attributes\DataProvider;
910
use PHPUnit\Framework\Attributes\TestDox;
1011
use PHPUnit\Framework\TestCase;
@@ -347,6 +348,7 @@ public static function dataIsEmailInvalid(): array
347348
public static function dataIsURLValid(): array
348349
{
349350
return [
351+
[Http::createFromString('http://www.example.com')],
350352
['http://a.pl'],
351353
['http://www.example.com'],
352354
['http://tt.example.com'],
@@ -733,13 +735,39 @@ public static function dataIsUniqueOptionFields(): array
733735
],
734736
['latitude', 'longitude'],
735737
],
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+
],
736763
];
737764
}
738765

739766
public static function dataIsNotUnique(): array
740767
{
741768
return [
742769
'empty' => [[]],
770+
'non-array' => ['string'],
743771
'sequential' => [[1, 2, 2]], // index 1 and 2 are not unique.
744772
'associative' => [['a' => 1, 'b' => 2, 'c' => 2]], // b and c are not unique.
745773
'multidimensional' => [['a' => 1, 'b' => [1, 2], 'c' => [1, 2]]], // b and c are not unique.

0 commit comments

Comments
 (0)