-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
137 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'with specific php version' do | ||
case default[:platform] | ||
when %r{ubuntu} | ||
packagename = 'php5.6-fpm' | ||
when %{el} | ||
# ell = Enterprise Linux = CentOS.... | ||
packagename = 'php-fpm' | ||
when %r{debian} | ||
packagename = 'php5-fpm' | ||
end | ||
|
||
context 'with params' do | ||
it 'works with 5.6' do | ||
pp = <<-EOS | ||
class { 'php::globals': | ||
php_version => '5.6', | ||
} | ||
-> class { 'php': | ||
ensure => 'present', | ||
manage_repos => true, | ||
fpm => true, | ||
dev => true, | ||
composer => true, | ||
pear => true, | ||
phpunit => false, | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
describe package(packagename) do | ||
it { is_expected.to be_installed } | ||
end | ||
describe service(packagename) do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
describe command('php --version') do | ||
its(:stdout) { is_expected.to match %r{5\.6} } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'php' do | ||
it 'works with defaults' do | ||
pp = 'include php' | ||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
describe 'php with default settings' do | ||
context 'default parameters' do | ||
it 'works with defaults' do | ||
pp = 'include php' | ||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
case default[:platform] | ||
when %r{16.04} | ||
describe package('php7.0-fpm') do | ||
it { is_expected.to be_installed } | ||
case default[:platform] | ||
when %r{ubuntu-16.04} | ||
packagename = 'php7.0-fpm' | ||
when %r{ubuntu-14.04} | ||
packagename = 'php5-fpm' | ||
when %r{el} | ||
packagename = 'php-fpm' | ||
when %r{debian} | ||
packagename = 'php5-fpm' | ||
end | ||
when %r{14.04} | ||
describe package('php5-fpm') do | ||
describe package(packagename) do | ||
it { is_expected.to be_installed } | ||
end | ||
when %(7) | ||
describe package('php-fpm') do | ||
it { is_expected.to be_installed } | ||
|
||
describe service(packagename) do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
end | ||
end |