Fix error on test:all command.

This commit is contained in:
marco
2015-08-13 17:42:24 +02:00
parent 32fb4ee6fa
commit b72db327f7
2 changed files with 19 additions and 26 deletions

View File

@@ -16,28 +16,28 @@ class RoboFile extends \Robo\Tasks {
function watch() { function watch() {
$files = array( $files = array(
// global admin styles // global admin styles
'assets/css/src/admin.styl', 'assets/css/src/admin.styl',
// rtl specific styles // rtl specific styles
'assets/css/src/rtl.styl' 'assets/css/src/rtl.styl'
); );
$command = array( $command = array(
'./node_modules/stylus/bin/stylus -u', './node_modules/stylus/bin/stylus -u',
' nib -w' . join(' ', $files) . ' -o assets/css/' ' nib -w' . join(' ', $files) . ' -o assets/css/'
); );
$this->_exec(join(' ', $command)); $this->_exec(join(' ', $command));
} }
function makepot() { function makepot() {
$this->_exec('grunt makepot' . ' --gruntfile ' $this->_exec('grunt makepot' . ' --gruntfile '
. __DIR__ . '/tasks/makepot/makepot.js' . __DIR__ . '/tasks/makepot/makepot.js'
. ' --base_path ' . __DIR__); . ' --base_path ' . __DIR__);
} }
function pushpot() { function pushpot() {
$this->_exec('grunt pushpot' . ' --gruntfile ' $this->_exec('grunt pushpot' . ' --gruntfile '
. __DIR__ . '/tasks/makepot/makepot.js' . __DIR__ . '/tasks/makepot/makepot.js'
. ' --base_path ' . __DIR__); . ' --base_path ' . __DIR__);
} }
function testUnit() { function testUnit() {
@@ -59,18 +59,18 @@ class RoboFile extends \Robo\Tasks {
$this->loadEnv(); $this->loadEnv();
$this->_exec('vendor/bin/codecept build'); $this->_exec('vendor/bin/codecept build');
$this->taskExec('phantomjs --webdriver=4444') $this->taskExec('phantomjs --webdriver=4444')
->background() ->background()
->run(); ->run();
sleep(2); sleep(2);
$this->_exec('vendor/bin/codecept run acceptance'); $this->_exec('vendor/bin/codecept run acceptance');
} }
function testAll() { function testAll() {
$this->_exec('vendor/bin/codecept build');
$this->loadEnv(); $this->loadEnv();
$this->_exec('vendor/bin/codecept build');
$this->taskexec('phantomjs --webdriver=4444') $this->taskexec('phantomjs --webdriver=4444')
->background() ->background()
->run(); ->run();
sleep(2); sleep(2);
$this->_exec('vendor/bin/codecept run'); $this->_exec('vendor/bin/codecept run');
} }
@@ -86,12 +86,12 @@ class RoboFile extends \Robo\Tasks {
$dotenv->load(); $dotenv->load();
$this->taskWriteToFile('tests/acceptance.suite.yml') $this->taskWriteToFile('tests/acceptance.suite.yml')
->textFromFile('tests/acceptance.suite.src') ->textFromFile('tests/acceptance.suite.src')
->run(); ->run();
$this->taskReplaceInFile('tests/acceptance.suite.yml') $this->taskReplaceInFile('tests/acceptance.suite.yml')
->regex("/url.*/") ->regex("/url.*/")
->to('url: ' . "'" . getenv('WP_TEST_URL') . "'") ->to('url: ' . "'" . getenv('WP_TEST_URL') . "'")
->run(); ->run();
} }
} }

View File

@@ -3,14 +3,7 @@
$console = new \Codeception\Lib\Console\Output([]); $console = new \Codeception\Lib\Console\Output([]);
$console->writeln('Loading WP core...'); $console->writeln('Loading WP core...');
$wordpress_path = getenv('WP_TEST_PATH'); require_once(getenv('WP_TEST_PATH') . '/wp-load.php');
if ($wordpress_path) {
if (file_exists($wordpress_path . '/wp-load.php')) {
require_once(getenv('WP_TEST_PATH') . '/wp-load.php');
}
} else {
throw new Exception("You need to specify the path to your WordPress installation\n`WP_TEST_PATH` in your .env file");
}
$console->writeln('Cleaning up database...'); $console->writeln('Cleaning up database...');
$models = array( $models = array(