|
@@ 189-202 (lines=14) @@
|
| 186 |
|
$this->registry->addAction('email', $this->action2, 100); |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
public function testAct() |
| 190 |
|
{ |
| 191 |
|
$this->registry->addAction('database', $this->action1, 1); |
| 192 |
|
$this->registry->addAction('email', $this->action2, 2); |
| 193 |
|
|
| 194 |
|
$this->action1->expects($this->once()) |
| 195 |
|
->method('act') |
| 196 |
|
->with($this->event); |
| 197 |
|
|
| 198 |
|
$this->action2->expects($this->never()) |
| 199 |
|
->method('act'); |
| 200 |
|
|
| 201 |
|
$this->registry->act($this->event); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
public function testActWithContentTypeThatDoesNotHaveConfiguration() |
| 205 |
|
{ |
|
@@ 204-216 (lines=13) @@
|
| 201 |
|
$this->registry->act($this->event); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
public function testActWithContentTypeThatDoesNotHaveConfiguration() |
| 205 |
|
{ |
| 206 |
|
$this->registry->addAction('database', $this->action1, 1); |
| 207 |
|
$this->registry->addAction('email', $this->action2, 2); |
| 208 |
|
|
| 209 |
|
$this->action1->expects($this->never()) |
| 210 |
|
->method('act'); |
| 211 |
|
|
| 212 |
|
$this->action2->expects($this->once()) |
| 213 |
|
->method('act'); |
| 214 |
|
|
| 215 |
|
$this->registry->act($this->event2); |
| 216 |
|
} |
| 217 |
|
|
| 218 |
|
public function testActWithDefaultConfigOnly() |
| 219 |
|
{ |
|
@@ 218-230 (lines=13) @@
|
| 215 |
|
$this->registry->act($this->event2); |
| 216 |
|
} |
| 217 |
|
|
| 218 |
|
public function testActWithDefaultConfigOnly() |
| 219 |
|
{ |
| 220 |
|
$this->registryWithOnlyDefaultConf->addAction('database', $this->action1, 1); |
| 221 |
|
$this->registryWithOnlyDefaultConf->addAction('email', $this->action2, 2); |
| 222 |
|
|
| 223 |
|
$this->action1->expects($this->once()) |
| 224 |
|
->method('act'); |
| 225 |
|
|
| 226 |
|
$this->action2->expects($this->once()) |
| 227 |
|
->method('act'); |
| 228 |
|
|
| 229 |
|
$this->registryWithOnlyDefaultConf->act($this->event2); |
| 230 |
|
} |
| 231 |
|
|
| 232 |
|
public function testActWithEmptyConfig() |
| 233 |
|
{ |
|
@@ 232-244 (lines=13) @@
|
| 229 |
|
$this->registryWithOnlyDefaultConf->act($this->event2); |
| 230 |
|
} |
| 231 |
|
|
| 232 |
|
public function testActWithEmptyConfig() |
| 233 |
|
{ |
| 234 |
|
$this->registryWithEmptyConf->addAction('database', $this->action1, 1); |
| 235 |
|
$this->registryWithEmptyConf->addAction('email', $this->action2, 2); |
| 236 |
|
|
| 237 |
|
$this->action1->expects($this->never()) |
| 238 |
|
->method('act'); |
| 239 |
|
|
| 240 |
|
$this->action2->expects($this->never()) |
| 241 |
|
->method('act'); |
| 242 |
|
|
| 243 |
|
$this->registryWithEmptyConf->act($this->event2); |
| 244 |
|
} |
| 245 |
|
|
| 246 |
|
public function testActWithActionFailedException() |
| 247 |
|
{ |
|
@@ 411-425 (lines=15) @@
|
| 408 |
|
$this->registry->act($this->event); |
| 409 |
|
} |
| 410 |
|
|
| 411 |
|
public function testThrowExceptionWhenDebugIsFalse() |
| 412 |
|
{ |
| 413 |
|
$this->registry->addAction('crucial', $this->action5, 1); |
| 414 |
|
$this->registry->addAction('email', $this->action2, 2); |
| 415 |
|
|
| 416 |
|
$this->logger->expects($this->once()) |
| 417 |
|
->method('error') |
| 418 |
|
->with('InformationCollection action crucial failed with reason test'); |
| 419 |
|
|
| 420 |
|
$this->action2->expects($this->never()) |
| 421 |
|
->method('act'); |
| 422 |
|
|
| 423 |
|
$this->registry->setDebug(false); |
| 424 |
|
$this->registry->act($this->event); |
| 425 |
|
} |
| 426 |
|
} |
| 427 |
|
|