/** * @runInSeparateProcess */ public function testBoostrapWithDefaultConstants() { #$this->markTestIncomplete(); $baseDir = dirname(dirname(__DIR__)) . '/vendor/inpsyde/wordpress-dev'; $testee = new WpTestsStarter($baseDir); // defined in phpunit-integration.xml $testee->defineDbName(Db\NAME); $testee->defineDbUser(Db\USER); $testee->defineDbPassword(Db\PASSWORD); $testee->defineDbHost(Db\HOST); $testee->defineDbCharset(Db\CHARSET); $testee->defineDbCollate(Db\COLLATE); $testee->setTablePrefix(Db\TABLE_PREFIX); $testee->bootstrap(); $this->assertFileExists($testee->getConfigFile()); $config_data = file_get_contents($testee->getConfigFile()); $this->assertRegExp('~define\\(\\s\'ABSPATH\',\\s\'[^\']+\'~', $config_data); }
* Introduce plugin test suite. */ echo "\n"; echo "[0;32m CleverReach Extension Test Suite [0m" . "\n"; echo "[0;32m Version: 0.3.0 [0m" . "\n"; echo "\n"; /** * Define base directory. */ $baseDir = dirname(__DIR__); /** * Require composer dependencies. */ $autoloadFile = $baseDir . '/vendor/autoload.php'; if (file_exists($autoloadFile)) { require_once $autoloadFile; } /** * Setup test environment using WP Tests Starter. * * @link https://github.com/inpsyde/WP-Tests-Starter */ $starter = new WpTestsStarter($baseDir . '/vendor/inpsyde/wordpress-dev'); $starter->defineDbName(DB_NAME); $starter->defineDbUser(DB_USER); $starter->defineDbPassword(DB_PASSWORD); $starter->defineDbHost(DB_HOST); $starter->defineDbCharset(DB_CHARSET); $starter->defineDbCollate(DB_COLLATE); $starter->setTablePrefix(DB_TABLE_PREFIX); $starter->bootstrap();