Closed amenk closed 11 years ago
Correction:
I made a small test module to reproduce this: https://github.com/amenk/N98_EcomDevPHPUnitIssue
phpunit.phar --debug --filter N98_EcomDevPHPUnitIssue_Test_Controller_TestController PHPUnit 3.7.13 by Sebastian Bergmann.
Configuration read from tests/integration/phpunit.xml
Starting test 'N98_EcomDevPHPUnitIssue_Test_Controller_TestController::aAction'. . Starting test 'N98_EcomDevPHPUnitIssue_Test_Controller_TestController::bAction'. F
Time: 5 seconds, Memory: 55.50Mb
There was 1 failure:
1) N98_EcomDevPHPUnitIssue_Test_Controller_TestController::bAction event was not really fired Failed asserting that null is true.
app/code/local/N98/EcomDevPHPUnitIssue/Test/Controller/TestController.php:30 phpunit.phar:524
FAILURES! Tests: 2, Assertions: 4, Failures: 1.
phpunit.phar --debug --filter N98_EcomDevPHPUnitIssue_Test_Controller_TestController::bAction PHPUnit 3.7.13 by Sebastian Bergmann.
Configuration read from tests/integration/phpunit.xml
Starting test 'N98_EcomDevPHPUnitIssue_Test_Controller_TestController::bAction'. .
Time: 4 seconds, Memory: 36.50Mb
OK (1 test, 4 assertions)
I created the issue in the wrong project - shame on my. Here is the right one: https://github.com/IvanChepurnyi/EcomDev_PHPUnit/issues/85
I have a module that registers a frontend event "controller_action_predispatch_wishlist_index_send"
Steps to reproduce:
If I directly dispatch the "right" action, i.e. the action that fires the event, it will be fired:
Steps to reproduce:
I debugged this a little and there seems to be some kind of caching problem. After the first dispatch, the event cache is already initialized. Now during the second call, events that have not fired before, are just ignored.
This happens if I have the dispatches in 1. and 2. in different tests as well as in the same test.