These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * This is project's console commands configuration for Robo task runner. |
||
4 | * |
||
5 | * @see http://robo.li/ |
||
6 | */ |
||
7 | class RoboFile extends \Robo\Tasks |
||
0 ignored issues
–
show
|
|||
8 | { |
||
9 | // define public methods as commands |
||
10 | |||
11 | function scripts() { |
||
12 | |||
13 | $this->taskMinify('assets/maps.js') |
||
14 | ->to('dist/scripts/maps.min.js') |
||
15 | ->run(); |
||
16 | |||
17 | } |
||
18 | |||
19 | function tests() |
||
20 | { |
||
21 | |||
22 | $this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run(); |
||
23 | $this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run(); |
||
24 | $this->taskSvnStack() |
||
25 | ->checkout('https://develop.svn.wordpress.org/tags/4.8.3 wp-tests') |
||
26 | ->run(); |
||
27 | |||
28 | $this->setTestConfig(); |
||
29 | $this->phpunit(); |
||
30 | |||
31 | } |
||
32 | |||
33 | function phpunit() |
||
34 | { |
||
35 | $this->taskPhpUnit('vendor/bin/phpunit') |
||
36 | ->configFile('tests/phpunit.xml.dist') |
||
37 | ->run(); |
||
38 | } |
||
39 | |||
40 | private function setTestConfig() |
||
41 | { |
||
42 | |||
43 | if (file_exists('wp-tests/wp-tests-config-sample.php')) { |
||
44 | copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php'); |
||
45 | } |
||
46 | |||
47 | $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
||
48 | ->from('youremptytestdbnamehere') |
||
49 | ->to('test_db') |
||
50 | ->run(); |
||
51 | |||
52 | $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
||
53 | ->from('yourusernamehere') |
||
54 | ->to('root') |
||
55 | ->run(); |
||
56 | |||
57 | $this->taskReplaceInFile( 'wp-tests/wp-tests-config.php') |
||
58 | ->from('yourpasswordhere') |
||
59 | ->to('') |
||
60 | ->run(); |
||
61 | } |
||
62 | |||
63 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.