cakephp/cakephp — pull request #5268 by berrygoudswaard (2014-11-26 18:22:05+00:00)
Title: Reset global EventManager on IntegrationTestCase setup

Events are attached for each test, because the EventManager is not reset for each test.

**Example**
* I attach an eventListener in the bootstrap.php or Controller::beforeFilter by using EventManager::attach().
* Then I create an integration test with multiple tests. Each test sends a request using one of the convenience methods, like IntegrationTestCase::get()

In the above example an eventListener is attached to the global EventManager on every executed test. This means that the callback is also executed multiple times.

This is prevented by resetting the EventManager in IntegrationTestCase::setup().

Not sure if this is the best way to fix it.