From 1e7a0d4e5e99864dec9f7cfecfd7a217cac432a6 Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Fri, 6 Mar 2015 10:46:46 -0500 Subject: [PATCH] Disable Events without Disabling Event Capture Signed-off-by: Michael A. Smith --- .../community/EcomDev/PHPUnit/Model/App.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/community/EcomDev/PHPUnit/Model/App.php b/app/code/community/EcomDev/PHPUnit/Model/App.php index 53724721..e5398fc0 100644 --- a/app/code/community/EcomDev/PHPUnit/Model/App.php +++ b/app/code/community/EcomDev/PHPUnit/Model/App.php @@ -225,10 +225,10 @@ public function initTest() $this->replaceRegistry(self::REGISTRY_PATH_SHARED_STORAGE, new Varien_Object()); return $this; } - + /** * Sets cache options for test case - * + * * @param array $options * @return EcomDev_PHPUnit_Model_App */ @@ -243,7 +243,7 @@ public function setCacheOptions(array $options) /** * Retrieve cache options for test case - * + * * @return array */ public function getCacheOptions() @@ -358,7 +358,7 @@ public function removeEventArea($code) /** * Returns request for test suite - * + * * @see Mage_Core_Model_App::getRequest() * @return EcomDev_PHPUnit_Controller_Request_Http */ @@ -376,7 +376,7 @@ public function getRequest() /** * Returns response for test suite - * + * * @see Mage_Core_Model_App::getResponse() * @return EcomDev_PHPUnit_Controller_Response_Http */ @@ -527,14 +527,14 @@ public function dispatchEvent($eventName, $args) { if ($this->_eventsEnabled) { parent::dispatchEvent($eventName, $args); + } - if (!isset($this->_dispatchedEvents[$eventName])) { - $this->_dispatchedEvents[$eventName] = 0; - } - - $this->_dispatchedEvents[$eventName]++; + if (!isset($this->_dispatchedEvents[$eventName])) { + $this->_dispatchedEvents[$eventName] = 0; } + $this->_dispatchedEvents[$eventName]++; + return $this; }