Visualphpunit\Core\Suite::getSuite PHP Method

getSuite() public static method

Get test suite results
public static getSuite ( Doctrine\DBAL\Connection $connection, integer $id ) : mixed[]
$connection Doctrine\DBAL\Connection
$id integer
return mixed[]
    public static function getSuite(Connection $connection, $id)
    {
        $sql = 'SELECT suite FROM suites WHERE id=?;';
        $stmt = $connection->prepare($sql);
        $stmt->bindValue(1, $id);
        $stmt->execute();
        return json_decode($stmt->fetch()['suite']);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Get archived test suite
  *
  * Get archived test suite data
  *
  * @param integer $id
  * @param \Symfony\Component\HttpFoundation\Request $request
  * @param \Silex\Application $app
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function suite($id, Request $request, Application $app)
 {
     $suite = Suite::getSuite($app['db'], $id);
     return $this->ok($suite);
 }