File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1797,8 +1797,22 @@ public function testPluralPascal(): void
1797
1797
$ this ->assertSame ('UserGroups ' , Str::pluralPascal ('UserGroup ' ));
1798
1798
$ this ->assertSame ('ProductCategories ' , Str::pluralPascal ('ProductCategory ' ));
1799
1799
1800
-
1801
-
1800
+ // Test with different count values and array
1801
+ $ this ->assertSame ('UserGroups ' , Str::pluralPascal ('UserGroup ' , 0 )); // plural
1802
+ $ this ->assertSame ('UserGroup ' , Str::pluralPascal ('UserGroup ' , 1 )); // singular
1803
+ $ this ->assertSame ('UserGroups ' , Str::pluralPascal ('UserGroup ' , 2 )); // plural
1804
+ $ this ->assertSame ('UserGroups ' , Str::pluralPascal ('UserGroup ' , [])); // plural (empty array count is 0)
1805
+
1806
+ // Test with Countable
1807
+ $ countable = new class implements \Countable
1808
+ {
1809
+ public function count (): int
1810
+ {
1811
+ return 3 ;
1812
+ }
1813
+ };
1814
+
1815
+ $ this ->assertSame ('UserGroups ' , Str::pluralPascal ('UserGroup ' , $ countable ));
1802
1816
}
1803
1817
}
1804
1818
You can’t perform that action at this time.
0 commit comments