/**
  * Returns testcase given its hash
  *
  * @return TestCase
  */
 function getTestCaseByHash($testCaseHash)
 {
     $this->dbHandler = DBHandler::getInstance();
     $sql = "SELECT * FROM testcase\n                 WHERE id = " . $this->dbHandler->quote($testCaseHash);
     $result = $this->dbHandler->query($sql);
     if ($result) {
         $result->setFetchMode(PDO::FETCH_OBJ);
         $row = $result->fetch();
         return new TestCase($row->filename, null, $testCaseHash);
     }
     return;
 }
Beispiel #2
0
 private function get_db_instance()
 {
     //define( 'ROOT_DIR', dirname(__FILE__) );
     require_once dirname(__FILE__) . '/../connect.php';
     // Require needed classes
     $dbh = new DBHandler();
     // Create DBHandler
     // Check if database connection established successfully
     if ($dbh->getInstance() === null) {
         die("Fatal error : no database connection");
     }
     return $dbh;
 }
 /**
  * Retreives testCases hashs from db for given testSuite
  *
  * @param TestSuite $testSuite    Target test suite to populate
  *
  * @return Array
  */
 function getTestCasesHashs($testSuite)
 {
     $this->dbHandler = DBHandler::getInstance();
     $sql = "SELECT id FROM testcase WHERE testsuite_id like '%" . $testSuite->getTestSuiteName() . "%'";
     $result = $this->dbHandler->query($sql);
     if ($result && $result->rowCount() > 0) {
         return $result->fetchAll(PDO::FETCH_COLUMN, 0);
     }
     return array();
 }
 /**
  * Constructor of the class
  *
  * @param User $user The connected user
  *
  * @return Void
  */
 function __construct(User $user)
 {
     $this->user = $user;
     $this->dbHandler = DBHandler::getInstance();
 }
 /**
  * Constructor
  *
  * @return confElement
  */
 function confElement($userId)
 {
     $this->dbHandler = DBHandler::getInstance();
     $this->userId = $userId;
 }
Beispiel #6
0
 /**
  * Constructor
  *
  * @return user
  */
 function user()
 {
     $this->dbHandler = DBHandler::getInstance();
 }
Beispiel #7
0
 function getLastOldExecutionStatusByRspecLabel($rspecLabel)
 {
     $this->dbHandler = DBHandler::getInstance();
     $sql = "SELECT status FROM testcase_result\n                 WHERE rspec_label = " . $this->dbHandler->quote($rspecLabel) . " ORDER BY date DESC";
     $result = $this->dbHandler->query($sql);
     if ($result) {
         $result->setFetchMode(PDO::FETCH_OBJ);
         $row = $result->fetch();
         //if ($row->status == ResultManager::STATUS_FAILURE) {
         if ($row->status == "FAILURE") {
             return false;
         }
     }
     return true;
 }