@@ -8,63 +8,63 @@ |
||
| 8 | 8 | { |
| 9 | 9 | // define public methods as commands |
| 10 | 10 | |
| 11 | - function hello($opts = ['who' => 'unknown']) |
|
| 12 | - { |
|
| 13 | - print_r($opts); |
|
| 14 | - $this->say("Hello, " . $opts['who']); |
|
| 15 | - } |
|
| 11 | + function hello($opts = ['who' => 'unknown']) |
|
| 12 | + { |
|
| 13 | + print_r($opts); |
|
| 14 | + $this->say("Hello, " . $opts['who']); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - function scripts() { |
|
| 17 | + function scripts() { |
|
| 18 | 18 | |
| 19 | - $this->taskMinify('assets/maps.js') |
|
| 20 | - ->to('dist/scripts/maps.min.js') |
|
| 21 | - ->run(); |
|
| 19 | + $this->taskMinify('assets/maps.js') |
|
| 20 | + ->to('dist/scripts/maps.min.js') |
|
| 21 | + ->run(); |
|
| 22 | 22 | |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - function tests() |
|
| 26 | - { |
|
| 25 | + function tests() |
|
| 26 | + { |
|
| 27 | 27 | |
| 28 | - $this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run(); |
|
| 29 | - $this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run(); |
|
| 30 | - $this->taskSvnStack() |
|
| 31 | - ->checkout('https://develop.svn.wordpress.org/tags/4.8.3 wp-tests') |
|
| 32 | - ->run(); |
|
| 28 | + $this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run(); |
|
| 29 | + $this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run(); |
|
| 30 | + $this->taskSvnStack() |
|
| 31 | + ->checkout('https://develop.svn.wordpress.org/tags/4.8.3 wp-tests') |
|
| 32 | + ->run(); |
|
| 33 | 33 | |
| 34 | - $this->setTestConfig(); |
|
| 35 | - $this->phpunit(); |
|
| 34 | + $this->setTestConfig(); |
|
| 35 | + $this->phpunit(); |
|
| 36 | 36 | |
| 37 | - } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - function phpunit() |
|
| 40 | - { |
|
| 41 | - $this->taskPhpUnit('vendor/bin/phpunit') |
|
| 42 | - ->configFile('tests/phpunit.xml.dist') |
|
| 43 | - ->envVars(array('WP_TESTS_DIR' => 'wp-tests')) |
|
| 44 | - ->run(); |
|
| 45 | - } |
|
| 39 | + function phpunit() |
|
| 40 | + { |
|
| 41 | + $this->taskPhpUnit('vendor/bin/phpunit') |
|
| 42 | + ->configFile('tests/phpunit.xml.dist') |
|
| 43 | + ->envVars(array('WP_TESTS_DIR' => 'wp-tests')) |
|
| 44 | + ->run(); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - private function setTestConfig() |
|
| 48 | - { |
|
| 47 | + private function setTestConfig() |
|
| 48 | + { |
|
| 49 | 49 | |
| 50 | - if (file_exists('wp-tests/wp-tests-config-sample.php')) { |
|
| 51 | - copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php'); |
|
| 52 | - } |
|
| 50 | + if (file_exists('wp-tests/wp-tests-config-sample.php')) { |
|
| 51 | + copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php'); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 55 | - ->from('youremptytestdbnamehere') |
|
| 56 | - ->to('test_db') |
|
| 57 | - ->run(); |
|
| 54 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 55 | + ->from('youremptytestdbnamehere') |
|
| 56 | + ->to('test_db') |
|
| 57 | + ->run(); |
|
| 58 | 58 | |
| 59 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 60 | - ->from('yourusernamehere') |
|
| 61 | - ->to('root') |
|
| 62 | - ->run(); |
|
| 59 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 60 | + ->from('yourusernamehere') |
|
| 61 | + ->to('root') |
|
| 62 | + ->run(); |
|
| 63 | 63 | |
| 64 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 65 | - ->from('yourpasswordhere') |
|
| 66 | - ->to('') |
|
| 67 | - ->run(); |
|
| 68 | - } |
|
| 64 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 65 | + ->from('yourpasswordhere') |
|
| 66 | + ->to('') |
|
| 67 | + ->run(); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | 70 | } |
| 71 | 71 | \ No newline at end of file |
@@ -8,16 +8,16 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | // define public methods as commands |
| 10 | 10 | |
| 11 | - function hello($opts = ['who' => 'unknown']) |
|
| 11 | + function hello( $opts = ['who' => 'unknown'] ) |
|
| 12 | 12 | { |
| 13 | - print_r($opts); |
|
| 14 | - $this->say("Hello, " . $opts['who']); |
|
| 13 | + print_r( $opts ); |
|
| 14 | + $this->say( "Hello, ".$opts['who'] ); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function scripts() { |
| 18 | 18 | |
| 19 | - $this->taskMinify('assets/maps.js') |
|
| 20 | - ->to('dist/scripts/maps.min.js') |
|
| 19 | + $this->taskMinify( 'assets/maps.js' ) |
|
| 20 | + ->to( 'dist/scripts/maps.min.js' ) |
|
| 21 | 21 | ->run(); |
| 22 | 22 | |
| 23 | 23 | } |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | function tests() |
| 26 | 26 | { |
| 27 | 27 | |
| 28 | - $this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run(); |
|
| 29 | - $this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run(); |
|
| 28 | + $this->taskExec( 'mysql -e "CREATE DATABASE IF NOT EXISTS test_db"' )->run(); |
|
| 29 | + $this->taskExec( 'mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"' )->run(); |
|
| 30 | 30 | $this->taskSvnStack() |
| 31 | - ->checkout('https://develop.svn.wordpress.org/tags/4.8.3 wp-tests') |
|
| 31 | + ->checkout( 'https://develop.svn.wordpress.org/tags/4.8.3 wp-tests' ) |
|
| 32 | 32 | ->run(); |
| 33 | 33 | |
| 34 | 34 | $this->setTestConfig(); |
@@ -38,32 +38,32 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | function phpunit() |
| 40 | 40 | { |
| 41 | - $this->taskPhpUnit('vendor/bin/phpunit') |
|
| 42 | - ->configFile('tests/phpunit.xml.dist') |
|
| 43 | - ->envVars(array('WP_TESTS_DIR' => 'wp-tests')) |
|
| 41 | + $this->taskPhpUnit( 'vendor/bin/phpunit' ) |
|
| 42 | + ->configFile( 'tests/phpunit.xml.dist' ) |
|
| 43 | + ->envVars( array( 'WP_TESTS_DIR' => 'wp-tests' ) ) |
|
| 44 | 44 | ->run(); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | private function setTestConfig() |
| 48 | 48 | { |
| 49 | 49 | |
| 50 | - if (file_exists('wp-tests/wp-tests-config-sample.php')) { |
|
| 51 | - copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php'); |
|
| 50 | + if ( file_exists( 'wp-tests/wp-tests-config-sample.php' ) ) { |
|
| 51 | + copy( 'wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php' ); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 55 | - ->from('youremptytestdbnamehere') |
|
| 56 | - ->to('test_db') |
|
| 54 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php' ) |
|
| 55 | + ->from( 'youremptytestdbnamehere' ) |
|
| 56 | + ->to( 'test_db' ) |
|
| 57 | 57 | ->run(); |
| 58 | 58 | |
| 59 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 60 | - ->from('yourusernamehere') |
|
| 61 | - ->to('root') |
|
| 59 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php' ) |
|
| 60 | + ->from( 'yourusernamehere' ) |
|
| 61 | + ->to( 'root' ) |
|
| 62 | 62 | ->run(); |
| 63 | 63 | |
| 64 | - $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
|
| 65 | - ->from('yourpasswordhere') |
|
| 66 | - ->to('') |
|
| 64 | + $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php' ) |
|
| 65 | + ->from( 'yourpasswordhere' ) |
|
| 66 | + ->to( '' ) |
|
| 67 | 67 | ->run(); |
| 68 | 68 | } |
| 69 | 69 | |