/** * @beforeClass */ public static function setUpSomeSharedFixtures() { self::$logger = QCLogger::getInstance(); self::$csvRecords = Registry::getInstance()->get('csvRecords'); self::$revenueOrdersModel = Registry::getInstance()->get('revReportModel'); parent::setUpSharedFixtures(); }
public function testSetup() { if (Registry::getInstance()->isRegistered("revenueReportFile")) { $revenueReportFile = Registry::getInstance()->get("revenueReportFile"); $this->assertFileExists($revenueReportFile, "Revenue report (" . $revenueReportFile . " ) is not found"); } else { $this->assertTrue(false, "revenueReportFile is not set up"); } }
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) { $this->logger->info("Test " . $test->getName() . " threw error"); $errorTestcases = Registry::getInstance()->get(self::ERR_TESTCASES_KEY); $errorArray = array(); $errorArray[0] = $test; $errorArray[1] = $e; array_push($errorTestcases, $errorArray); Registry::getInstance()->replace(self::ERR_TESTCASES_KEY, $errorTestcases); $this->logger->info("Adding errored test " . $test->getName() . " to the Registry " . print_r($errorTestcases, true)); $this->logger->info("End " . __METHOD__); }
/** * */ public static function setUpSharedFixtures() { // self::$logger = QCLogger::getInstance(); // self::$revenueOrdersModel = Registry::getInstance()->get('revReportModel'); if (!isset(self::$logger)) { self::$logger = QCLogger::getInstance(); } self::$logger->info("BEGIN " . __METHOD__); if (!isset(self::$revenueOrdersModel)) { self::$revenueOrdersModel = Registry::getInstance()->get('revReportModel'); //if still its not set throw exception if (!isset(self::$revenueOrdersModel)) { throw new Exception("Not bootstrapped properly. Missing revenueOrdersModel"); } } self::$logger->debug("Revenue orders" . PHP_EOL . print_r(self::$revenueOrdersModel->getOrders(), true)); self::$logger->info("END " . __METHOD__); }
public static function isTestSuccessful() { $registry = Registry::getInstance(); //logic is if failure and error keys are not registered then setup has failed //if they are registered and if they are non-empty then test cases are not successful if ($registry->isRegistered(BaseTestListener::FAILURE_TESTCASES_KEY)) { if (Registry::getInstance()->get(BaseTestListener::FAILURE_TESTCASES_KEY)) { return false; } } else { return false; } if ($registry->isRegistered(BaseTestListener::ERR_TESTCASES_KEY)) { if ($registry->get(BaseTestListener::ERR_TESTCASES_KEY)) { return false; } } else { return false; } return true; }
/** * @beforeClass */ public static function setUpSomeSharedFixtures() { self::$logger = QCLogger::getInstance(); self::$csvRecords = Registry::getInstance()->get('csvRecords'); }