File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -72,4 +72,39 @@ public function test_to_string(): void
7272
7373 $ this ->assertEquals ($ expected , $ this ->violationStore ->toString ());
7474 }
75+
76+ public function test_get_iterable (): void
77+ {
78+ $ violation = new Violation (
79+ 'App\Controller\Shop ' ,
80+ 'should have name end with Controller '
81+ );
82+ $ this ->violationStore ->add ($ violation );
83+ $ iterable = $ this ->violationStore ->getIterator ();
84+
85+ $ this ->assertEquals ([
86+ $ this ->violation ,
87+ $ violation
88+ ], \iterator_to_array ($ iterable ));
89+ }
90+
91+ public function test_get_array (): void
92+ {
93+ $ violation1 = new Violation (
94+ 'App\Controller\Shop ' ,
95+ 'should have name end with Controller '
96+ );
97+ $ violation2 = new Violation (
98+ 'App\Controller\Shop ' ,
99+ 'should implement AbstractController '
100+ );
101+ $ this ->violationStore ->add ($ violation1 );
102+ $ this ->violationStore ->add ($ violation2 );
103+
104+ $ this ->assertEquals ([
105+ $ this ->violation ,
106+ $ violation1 ,
107+ $ violation2 ,
108+ ], $ this ->violationStore ->toArray ());
109+ }
75110}
You can’t perform that action at this time.
0 commit comments