Visualphpunit\Core\Suite::getSnapshots PHP Method

getSnapshots() public static method

Get all test suite results
public static getSnapshots ( Doctrine\DBAL\Connection $connection ) : mixed[]
$connection Doctrine\DBAL\Connection
return mixed[]
    public static function getSnapshots(Connection $connection)
    {
        $sql = 'SELECT id, executed FROM suites ORDER BY datetime(executed) DESC;';
        $stmt = $connection->prepare($sql);
        $stmt->execute();
        return $stmt->fetchAll();
    }

Usage Example

コード例 #1
0
 /**
  * Get archived test suites
  *
  * Get all archived test suites
  *
  * @param \Symfony\Component\HttpFoundation\Request $request
  * @param \Silex\Application $app
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function index(Request $request, Application $app)
 {
     $suites = Suite::getSnapshots($app['db']);
     return $this->ok($this->parse($suites));
 }