Skip to content

Commit efce6a7

Browse files
committed
Add phpunit as a dependency
1 parent 6803918 commit efce6a7

File tree

2 files changed

+3
-42
lines changed

2 files changed

+3
-42
lines changed

chassis.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
#
66
# Values: 2
77
version: 2
8+
9+
dependencies:
10+
- phpunit

modules/tester/manifests/init.pp

-42
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Tester extension for Chassis
22
class tester (
33
$config,
4-
$install_path = '/usr/local/src/phpunit',
54
) {
65

76
if ( !empty($config[disabled_extensions]) and 'chassis/tester' in $config[
@@ -12,38 +11,6 @@
1211
}
1312

1413
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-
}
4714

4815
if ( $config[tester_db] ) {
4916
mysql::db { $config[tester_db][name]:
@@ -55,14 +22,5 @@
5522
}
5623

5724
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-
}
6725
}
6826
}

0 commit comments

Comments
 (0)