106 : void
107 {
108 $processor1_stack = [];
109 $this->processor1
110 ->method("beginComponent")
111 ->willReturnCallback(function ($s1, $s2) use (&$processor1_stack) {
112 $processor1_stack[] = "beginComponent";
113 $processor1_stack[] = $s1;
114 $processor1_stack[] = $s2;
115 });
116 $this->processor1
117 ->method("endComponent")
118 ->willReturnCallback(function ($s1, $s2) use (&$processor1_stack) {
119 $processor1_stack[] = "endComponent";
120 $processor1_stack[] = $s1;
121 $processor1_stack[] = $s2;
122 });
123 $this->processor1
124 ->method("beginTag")
125 ->willReturnCallback(function ($s1, $s2) use (&$processor1_stack) {
126 $processor1_stack[] = "beginTag";
127 $processor1_stack[] = $s1;
128 $processor1_stack[] = $s2;
129 });
130 $this->processor1
131 ->method("endTag")
132 ->willReturnCallback(function ($s1) use (&$processor1_stack) {
133 $processor1_stack[] = "endTag";
134 $processor1_stack[] = $s1;
135 });
136
137 $processor2_stack = [];
138 $this->processor2
139 ->method("beginComponent")
140 ->willReturnCallback(function ($s1, $s2) use (&$processor2_stack) {
141 $processor2_stack[] = "beginComponent";
142 $processor2_stack[] = $s1;
143 $processor2_stack[] = $s2;
144 });
145 $this->processor2
146 ->method("endComponent")
147 ->willReturnCallback(function ($s1, $s2) use (&$processor2_stack) {
148 $processor2_stack[] = "endComponent";
149 $processor2_stack[] = $s1;
150 $processor2_stack[] = $s2;
151 });
152 $this->processor2
153 ->method("beginTag")
154 ->willReturnCallback(function ($s1, $s2) use (&$processor2_stack) {
155 $processor2_stack[] = "beginTag";
156 $processor2_stack[] = $s1;
157 $processor2_stack[] = $s2;
158 });
159 $this->processor2
160 ->method("endTag")
161 ->willReturnCallback(function ($s1) use (&$processor2_stack) {
162 $processor2_stack[] = "endTag";
163 $processor2_stack[] = $s1;
164 });
165
166
167 $this->reader->readComponentDefinitions();
168
169
170 $this->assertEquals([self::$components[0][2], self::$components[1][2]], $this->reader->read_files);
171
172 $expected_processor_stack = [
173 "beginComponent",
174 self::$components[0][1],
175 self::$components[0][0],
176 "beginTag",
177 "module", ["a1" => "a1", "a2" => "a2"],
178 "beginTag",
179 "tag1", [],
180 "beginTag",
181 "tag11", [],
182 "endTag",
183 "tag11",
184 "endTag",
185 "tag1",
186 "beginTag",
187 "tag2", [],
188 "endTag",
189 "tag2",
190 "endTag",
191 "module",
192 "endComponent",
193 self::$components[0][1],
194 self::$components[0][0],
195 "beginComponent",
196 self::$components[1][1],
197 self::$components[1][0],
198 "beginTag",
199 "service", [],
200 "endTag",
201 "service",
202 "endComponent",
203 self::$components[1][1],
204 self::$components[1][0],
205 ];
206 $this->assertEquals($expected_processor_stack, $processor1_stack);
207 $this->assertEquals($expected_processor_stack, $processor2_stack);
208 }