예제 #1
0
 /**
  * Fetches a run object from the database.
  *
  * @param   string  $runId
  *
  * @return  Run
  */
 public function retrieve($runId)
 {
     $conn = $this->database->getConnection();
     $stmt = $conn->prepare('SELECT run_id, ts_created, ts_accessed' . ' FROM runs' . ' WHERE run_id = :run_id');
     $stmt->bindValue(':run_id', $runId);
     $stmt->execute();
     $result = $stmt->fetch(\PDO::FETCH_ASSOC);
     if (false === $result) {
         return null;
     }
     return $this->runFactory->fromDatabaseArray($result);
 }
예제 #2
0
 public function testConnectionSucceeded()
 {
     $config = Container::get('Config');
     $database = new Database($config);
     $this->assertInstanceOf('\\PDO', $database->getConnection());
 }