/** * 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); }
public function testConnectionSucceeded() { $config = Container::get('Config'); $database = new Database($config); $this->assertInstanceOf('\\PDO', $database->getConnection()); }