@@ 182-195 (lines=14) @@ | ||
179 | $this->registry->addAction('email', $this->action2, 100); |
|
180 | } |
|
181 | ||
182 | public function testAct() |
|
183 | { |
|
184 | $this->registry->addAction('database', $this->action1, 1); |
|
185 | $this->registry->addAction('email', $this->action2, 2); |
|
186 | ||
187 | $this->action1->expects($this->once()) |
|
188 | ->method('act') |
|
189 | ->with($this->event); |
|
190 | ||
191 | $this->action2->expects($this->never()) |
|
192 | ->method('act'); |
|
193 | ||
194 | $this->registry->act($this->event); |
|
195 | } |
|
196 | ||
197 | public function testActWithContentTypeThatDoesNotHaveConfiguration() |
|
198 | { |
|
@@ 197-209 (lines=13) @@ | ||
194 | $this->registry->act($this->event); |
|
195 | } |
|
196 | ||
197 | public function testActWithContentTypeThatDoesNotHaveConfiguration() |
|
198 | { |
|
199 | $this->registry->addAction('database', $this->action1, 1); |
|
200 | $this->registry->addAction('email', $this->action2, 2); |
|
201 | ||
202 | $this->action1->expects($this->never()) |
|
203 | ->method('act'); |
|
204 | ||
205 | $this->action2->expects($this->once()) |
|
206 | ->method('act'); |
|
207 | ||
208 | $this->registry->act($this->event2); |
|
209 | } |
|
210 | ||
211 | public function testActWithDefaultConfigOnly() |
|
212 | { |
|
@@ 211-223 (lines=13) @@ | ||
208 | $this->registry->act($this->event2); |
|
209 | } |
|
210 | ||
211 | public function testActWithDefaultConfigOnly() |
|
212 | { |
|
213 | $this->registryWithOnlyDefaultConf->addAction('database', $this->action1, 1); |
|
214 | $this->registryWithOnlyDefaultConf->addAction('email', $this->action2, 2); |
|
215 | ||
216 | $this->action1->expects($this->once()) |
|
217 | ->method('act'); |
|
218 | ||
219 | $this->action2->expects($this->once()) |
|
220 | ->method('act'); |
|
221 | ||
222 | $this->registryWithOnlyDefaultConf->act($this->event2); |
|
223 | } |
|
224 | ||
225 | public function testActWithEmptyConfig() |
|
226 | { |
|
@@ 225-237 (lines=13) @@ | ||
222 | $this->registryWithOnlyDefaultConf->act($this->event2); |
|
223 | } |
|
224 | ||
225 | public function testActWithEmptyConfig() |
|
226 | { |
|
227 | $this->registryWithEmptyConf->addAction('database', $this->action1, 1); |
|
228 | $this->registryWithEmptyConf->addAction('email', $this->action2, 2); |
|
229 | ||
230 | $this->action1->expects($this->never()) |
|
231 | ->method('act'); |
|
232 | ||
233 | $this->action2->expects($this->never()) |
|
234 | ->method('act'); |
|
235 | ||
236 | $this->registryWithEmptyConf->act($this->event2); |
|
237 | } |
|
238 | ||
239 | public function testActWithActionFailedException() |
|
240 | { |