/** * Set up the directory for each test, ensuring it's empty */ public function setUp() { $this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'imboVariationsFilesystemIntegrationTest'; if (is_dir($this->path)) { $this->rmdir($this->path); } mkdir($this->path); parent::setUp(); }
/** * Make sure we have the mongo extension available and drop the test database just in case */ public function setUp() { if (!extension_loaded('mongo') || !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(); }
/** * Make sure we have the correct config available */ public function setUp() { foreach (['AWS_S3_KEY', 'AWS_S3_SECRET', 'AWS_S3_BUCKET'] as $key) { if (empty($GLOBALS[$key])) { $this->markTestSkipped('This test needs the ' . $key . ' value to be set in phpunit.xml'); } } $client = S3Client::factory(['key' => $GLOBALS['AWS_S3_KEY'], 'secret' => $GLOBALS['AWS_S3_SECRET']]); $client->clearBucket($GLOBALS['AWS_S3_BUCKET']); parent::setUp(); }
/** * Make sure we have the PDO and pdo_sqlite extension loaded, and Doctrine is installed */ 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 storage_image_variations ( publicKey TEXT NOT NULL, imageIdentifier TEXT NOT NULL, width INTEGER NOT NULL, data BLOB NOT NULL, PRIMARY KEY (publicKey,imageIdentifier,width) ) '); parent::setUp(); }