@@ -7,48 +7,48 @@ |
||
7 | 7 | class RoboFile extends \Robo\Tasks |
8 | 8 | { |
9 | 9 | // define public methods as commands |
10 | - function tests() |
|
11 | - { |
|
12 | - |
|
13 | - $this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run(); |
|
14 | - $this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run(); |
|
15 | - $this->taskSvnStack() |
|
16 | - ->checkout('https://develop.svn.wordpress.org/tags/4.8.3 wp-tests') |
|
17 | - ->run(); |
|
18 | - |
|
19 | - $this->setTestConfig(); |
|
20 | - $this->phpunit(); |
|
21 | - |
|
22 | - } |
|
23 | - |
|
24 | - function phpunit() |
|
25 | - { |
|
26 | - $this->taskPhpUnit('vendor/bin/phpunit') |
|
27 | - ->configFile('tests/phpunit.xml.dist') |
|
28 | - ->run(); |
|
29 | - } |
|
30 | - |
|
31 | - private function setTestConfig() |
|
32 | - { |
|
33 | - |
|
34 | - if (file_exists('wp-tests/wp-tests-config-sample.php')) { |
|
35 | - copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php'); |
|
36 | - } |
|
37 | - |
|
38 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
39 | - ->from('youremptytestdbnamehere') |
|
40 | - ->to('test_db') |
|
41 | - ->run(); |
|
42 | - |
|
43 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
44 | - ->from('yourusernamehere') |
|
45 | - ->to('root') |
|
46 | - ->run(); |
|
47 | - |
|
48 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
49 | - ->from('yourpasswordhere') |
|
50 | - ->to('') |
|
51 | - ->run(); |
|
52 | - } |
|
10 | + function tests() |
|
11 | + { |
|
12 | + |
|
13 | + $this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run(); |
|
14 | + $this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run(); |
|
15 | + $this->taskSvnStack() |
|
16 | + ->checkout('https://develop.svn.wordpress.org/tags/4.8.3 wp-tests') |
|
17 | + ->run(); |
|
18 | + |
|
19 | + $this->setTestConfig(); |
|
20 | + $this->phpunit(); |
|
21 | + |
|
22 | + } |
|
23 | + |
|
24 | + function phpunit() |
|
25 | + { |
|
26 | + $this->taskPhpUnit('vendor/bin/phpunit') |
|
27 | + ->configFile('tests/phpunit.xml.dist') |
|
28 | + ->run(); |
|
29 | + } |
|
30 | + |
|
31 | + private function setTestConfig() |
|
32 | + { |
|
33 | + |
|
34 | + if (file_exists('wp-tests/wp-tests-config-sample.php')) { |
|
35 | + copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php'); |
|
36 | + } |
|
37 | + |
|
38 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
39 | + ->from('youremptytestdbnamehere') |
|
40 | + ->to('test_db') |
|
41 | + ->run(); |
|
42 | + |
|
43 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
44 | + ->from('yourusernamehere') |
|
45 | + ->to('root') |
|
46 | + ->run(); |
|
47 | + |
|
48 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
49 | + ->from('yourpasswordhere') |
|
50 | + ->to('') |
|
51 | + ->run(); |
|
52 | + } |
|
53 | 53 | |
54 | 54 | } |
55 | 55 | \ No newline at end of file |