From 4271d6a2b1a4849b09ff3735b9ca8c52f5666a70 Mon Sep 17 00:00:00 2001 From: Cyril Labbe Date: Wed, 6 Jul 2016 12:29:14 +0200 Subject: [PATCH] reset data before each suite multiple suites can be launched (and/or with multiple environments) --- src/Teststatistics.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Teststatistics.php b/src/Teststatistics.php index 414e5b2..c91f901 100644 --- a/src/Teststatistics.php +++ b/src/Teststatistics.php @@ -39,11 +39,19 @@ public function _initialize() static $events = array( Events::TEST_BEFORE => 'beforeTest', Events::TEST_END => 'afterTest', + Events::SUITE_BEFORE => 'beforeSuite', Events::SUITE_AFTER => 'afterSuite', Events::STEP_BEFORE => 'beforeStep', Events::STEP_AFTER => 'afterStep' ); + // reset times and not performant tests arrays, in case multiple suites are launched + public function beforeSuite(SuiteEvent $e) + { + self::$testTimes = array(); + self::$notPerformantStepsByTest = array(); + } + // we are printing test status and time taken public function beforeTest(TestEvent $e) {