setUp() public method

Set up
public setUp ( )
Example #1
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();
 }
Example #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('imboIntegrationTestDatabase')->drop();
     parent::setUp();
 }
Example #3
0
 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("\n            CREATE TABLE IF NOT EXISTS imageinfo (\n                id INTEGER PRIMARY KEY NOT NULL,\n                user TEXT NOT NULL,\n                imageIdentifier TEXT NOT NULL,\n                size INTEGER NOT NULL,\n                extension TEXT NOT NULL,\n                mime TEXT NOT NULL,\n                added INTEGER NOT NULL,\n                updated INTEGER NOT NULL,\n                width INTEGER NOT NULL,\n                height INTEGER NOT NULL,\n                checksum TEXT NOT NULL,\n                originalChecksum TEXT NOT NULL,\n                UNIQUE (user,imageIdentifier)\n            )\n        ");
     $this->pdo->query("\n            CREATE TABLE IF NOT EXISTS metadata (\n                id INTEGER PRIMARY KEY NOT NULL,\n                imageId KEY INTEGER NOT NULL,\n                tagName TEXT NOT NULL,\n                tagValue TEXT NOT NULL\n            )\n        ");
     $this->pdo->query("\n            CREATE TABLE IF NOT EXISTS shorturl (\n                shortUrlId TEXT PRIMARY KEY NOT NULL,\n                user TEXT NOT NULL,\n                imageIdentifier TEXT NOT NULL,\n                extension TEXT,\n                query TEXT NOT NULL\n            )\n        ");
     $this->pdo->query("\n            CREATE INDEX shorturlparams ON shorturl (\n                user,\n                imageIdentifier,\n                extension,\n                query\n            )\n        ");
     parent::setUp();
 }