Completed
Push — master ( 4dc0e8...439184 )
by Hannes
22s queued 18s
created

bob_config.php ➔ shell()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Bob\BuildConfig;
4
5
task('default', ['test', 'sniff']);
6
7
desc('Run unit and feature tests');
8
task('test', ['phpunit', 'behat']);
9
10
desc('Run unit tests');
11
task('phpunit', function() {
12
    shell('phpunit');
13
    println('Unit tests passed');
14
});
15
16
desc('Run behat feature tests');
17
task('behat', function() {
18
    shell('behat --stop-on-failure');
19
    println('Behat feature tests passed');
20
});
21
22
desc('Run php code sniffer');
23
task('sniff', function() {
24
    shell('phpcs src tests --standard=PSR2');
25
    println('Syntax checker passed');
26
});
27
28
desc('Globally install development tools');
29
task('install_dev_tools', function() {
30
    shell('composer global require consolidation/cgr');
31
    shell('cgr phpunit/phpunit');
32
    shell('cgr behat/behat');
33
    shell('cgr squizlabs/php_codesniffer');
34
});
35
36
function shell(string $command)
37
{
38
    return sh($command, null, ['failOnError' => true]);
39
}
40