コード例 #1
0
 public function sanityAction()
 {
     // Get db
     if (Zend_Registry::isRegistered('Zend_Db') && ($db = Zend_Registry::get('Zend_Db')) instanceof Zend_Db_Adapter_Abstract) {
         Engine_Sanity::setDefaultDbAdapter($db);
     }
     // Get packages
     $packages = $this->_packageManager->listInstalledPackages();
     // Get dependencies
     $this->view->dependencies = $dependencies = $this->_packageManager->depend();
     // Get tests
     $this->view->tests = $tests = new Engine_Sanity();
     $packageIndex = array();
     foreach ($packages as $package) {
         $packageTests = $package->getTests();
         // No tests
         if (empty($packageTests)) {
             continue;
         }
         $packageIndex[$package->getKey()] = $package;
         // Make battery
         $battery = new Engine_Sanity(array('name' => $package->getKey()));
         foreach ($packageTests as $test) {
             $battery->addTest($test->toArray());
         }
         $tests->addTest($battery);
     }
     $this->view->packageIndex = $packageIndex;
     $tests->run();
 }
コード例 #2
0
ファイル: Abstract.php プロジェクト: robeendey/ce
 public function getTests()
 {
     // No resultant package
     $targetPackage = $this->getTargetPackage();
     if (!$targetPackage) {
         return false;
     }
     // No tests
     $tests = $targetPackage->getTests();
     if (empty($tests)) {
         return false;
     }
     // Make battery
     $battery = new Engine_Sanity(array('name' => $targetPackage->getKey()));
     foreach ($tests as $test) {
         $battery->addTest($test->toArray());
     }
     return $battery;
 }
コード例 #3
0
ファイル: Manager.php プロジェクト: robeendey/ce
 public function test($transaction)
 {
     // Verify transaction
     $transaction = $this->_verifyTransaction($transaction);
     // Check registry for db adapter
     if (Zend_Registry::isRegistered('Zend_Db') && ($db = Zend_Registry::get('Zend_Db')) instanceof Zend_Db_Adapter_Abstract) {
         Engine_Sanity::setDefaultDbAdapter($db);
     }
     // Make tests
     $batteries = new Engine_Sanity();
     foreach ($transaction as $operation) {
         $battery = $operation->getTests();
         if ($battery) {
             $batteries->addTest($battery);
         }
         unset($operation);
     }
     $batteries->run();
     return $batteries;
 }