File tree 2 files changed +3
-42
lines changed
2 files changed +3
-42
lines changed Original file line number Diff line number Diff line change 5
5
#
6
6
# Values: 2
7
7
version : 2
8
+
9
+ dependencies :
10
+ - phpunit
Original file line number Diff line number Diff line change 1
1
# Tester extension for Chassis
2
2
class tester (
3
3
$config,
4
- $install_path = ' /usr/local/src/phpunit' ,
5
4
) {
6
5
7
6
if ( !empty($config [disabled_extensions]) and ' chassis/tester' in $config [
12
11
}
13
12
14
13
if ( present == $tester ) {
15
- # Create the install path
16
- file { $install_path:
17
- ensure => directory ,
18
- }
19
-
20
- if versioncmp( $config [php], ' 5.6' ) == 0 {
21
- $phpunit_repo_url = ' https://phar.phpunit.de/phpunit-4.8.phar'
22
- } else {
23
- $phpunit_repo_url = ' https://phar.phpunit.de/phpunit-5.7.phar'
24
- }
25
-
26
- # Download phpunit
27
- exec { 'phpunit download' :
28
- command => " /usr/bin/curl -o ${install_path} /phpunit.phar -L ${
29
- phpunit_repo_url}" ,
30
- require => [ Package[ ' curl' ], File [ $install_path ] ],
31
- creates => " ${install_path} /phpunit.phar" ,
32
- }
33
-
34
- # Ensure we can run phpunit
35
- file { "${install_path}/phpunit.phar" :
36
- ensure => present ,
37
- mode => ' a+x' ,
38
- require => Exec[ ' phpunit download' ]
39
- }
40
-
41
- # Symlink it across
42
- file { '/usr/bin/phpunit' :
43
- ensure => link,
44
- target => " ${install_path} /phpunit.phar" ,
45
- require => File [ " ${install_path} /phpunit.phar" ],
46
- }
47
14
48
15
if ( $config [tester_db] ) {
49
16
mysql::db { $config [tester_db][name]:
55
22
}
56
23
57
24
class { 'tester::config' : }
58
-
59
- } else {
60
- file { $install_path:
61
- ensure => $tester ,
62
- force => true
63
- }
64
- file { '/usr/bin/phpunit' :
65
- ensure => absent
66
- }
67
25
}
68
26
}
You can’t perform that action at this time.
0 commit comments