Exemplo n.º 1
0
 /**
  * Make sure we have the PDO and pdo_sqlite extension available and create a new in-memory
  * table for every test
  */
 public function setUp()
 {
     if (!extension_loaded('PDO')) {
         $this->markTestSkipped('PDO is required to run this test');
     }
     if (!extension_loaded('pdo_sqlite')) {
         $this->markTestSkipped('pdo_sqlite is required to run this test');
     }
     if (!class_exists('Doctrine\\DBAL\\DriverManager')) {
         $this->markTestSkipped('Doctrine is required to run this test');
     }
     // Create tmp tables
     $this->pdo = new PDO('sqlite::memory:');
     $this->pdo->query('
         CREATE TABLE IF NOT EXISTS imagevariations (
             user TEXT NOT NULL,
             imageIdentifier TEXT NOT NULL,
             width INTEGER NOT NULL,
             height INTEGER NOT NULL,
             added INTEGER NOT NULL,
             PRIMARY KEY (user,imageIdentifier,width)
         )
     ');
     parent::setUp();
 }
Exemplo n.º 2
0
 /**
  * Make sure we have the mongo extension available and drop the test database just in case
  */
 public function setUp()
 {
     if (!class_exists('MongoClient')) {
         $this->markTestSkipped('pecl/mongo >= 1.3.0 is required to run this test');
     }
     $client = new MongoClient();
     $client->selectDB($this->databaseName)->drop();
     parent::setUp();
 }
Exemplo n.º 3
0
 /**
  * Make sure we have the mongo extension available and drop the test database just in case
  */
 public function setUp()
 {
     if (!class_exists('MongoDB\\Client')) {
         $this->markTestSkipped('pecl/mongodb >= 1.1.3 is required to run this test');
     }
     $client = new MongoClient();
     $client->dropDatabase($this->databaseName);
     parent::setUp();
 }