File tree Expand file tree Collapse file tree 1 file changed +25
-8
lines changed
tests/WS/Utils/Collections Expand file tree Collapse file tree 1 file changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ function () {
3636 },
3737 ],
3838 [
39- $ object = new class () {
40- },
39+ $ object = new class () {},
4140 clone $ object ,
4241 clone $ object ,
4342 ],
@@ -57,18 +56,15 @@ public function notStrictCases(): array
5756 function () {
5857 return '1 ' ;
5958 },
60- new class () {
61- },
59+ new class () {},
6260 function () {
6361 return 3 ;
6462 },
6563 ],
6664 [
67- $ object = new class () {
68- },
65+ $ object = new class () {},
6966 clone $ object ,
70- new class () {
71- },
67+ new class () {},
7268 ],
7369 ];
7470 }
@@ -94,4 +90,25 @@ public function creatingFromNotStrict(...$sequence): void
9490 self ::expectException (InvalidArgumentException::class);
9591 $ this ->createInstance (...$ sequence );
9692 }
93+
94+ /**
95+ * @test
96+ */
97+ public function addingElementsToStrictArray ()
98+ {
99+ self ::expectException (InvalidArgumentException::class);
100+
101+ $ this
102+ ->createInstance (1 , 2 , 3 )
103+ ->add ('4 ' );
104+
105+ $ this
106+ ->createInstance ('one ' , 'two ' , 'three ' )
107+ ->addAll (['4 ' , 5 , '6 ' ]);
108+
109+ $ object = new class () {};
110+ $ this
111+ ->createInstance ($ object , clone $ object , clone $ object )
112+ ->set (new class () {}, 2 );
113+ }
97114}
You can’t perform that action at this time.
0 commit comments