Visualphpunit\Core\Suite::createTable PHP Method

createTable() public static method

Create the table if it dos not exists
public static createTable ( Doctrine\DBAL\Connection $connection ) : boolean
$connection Doctrine\DBAL\Connection
return boolean
    public static function createTable(Connection $connection)
    {
        $sql = "CREATE TABLE IF NOT EXISTS suites(id INTEGER PRIMARY KEY AUTOINCREMENT, suite TEXT, executed NUMERIC);";
        $stmt = $connection->prepare($sql);
        return $stmt->execute();
    }

Usage Example

Beispiel #1
0
 /**
  * Run the selected test files
  *
  * Run the selected test with phpunit
  *
  * @param \Symfony\Component\HttpFoundation\Request $request
  * @param \Silex\Application $app
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function index(Request $request, Application $app)
 {
     Suite::createTable($app['db']);
     Test::createTable($app['db']);
     $data = json_decode($request->getContent(), true);
     if (count($data['files'])) {
         $parser = new Parser();
         $result = $parser->run($data['files']);
         if ($data['config']['snapshot']) {
             Suite::store($app['db'], $result);
         }
         Test::store($app['db'], $result);
         return $this->ok([$result]);
     }
     return $this->ok(['nofiles']);
 }
All Usage Examples Of Visualphpunit\Core\Suite::createTable