2020-12-22 15:42:11 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-06-26 01:34:51 +02:00
|
|
|
control 'Php package' do
|
|
|
|
title 'should be installed'
|
|
|
|
|
2020-12-22 15:42:11 +01:00
|
|
|
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
2019-09-04 01:12:28 +02:00
|
|
|
def test_debian
|
|
|
|
describe package('php-imagick') do
|
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe package('php-redis') do
|
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
|
2019-09-04 22:46:11 +02:00
|
|
|
describe package('php-xdebug') do
|
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
|
2019-09-04 01:12:28 +02:00
|
|
|
%w[
|
|
|
|
bz2 cli curl fpm gd imap intl mbstring
|
|
|
|
mysql readline xml zip
|
|
|
|
].each do |pkg|
|
|
|
|
describe package("php5.6-#{pkg}") do
|
|
|
|
it { should be_installed }
|
2019-08-13 16:33:57 +02:00
|
|
|
end
|
2019-09-04 01:12:28 +02:00
|
|
|
|
|
|
|
describe package("php7.3-#{pkg}") do
|
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-12-22 15:42:11 +01:00
|
|
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
2019-09-04 01:12:28 +02:00
|
|
|
|
|
|
|
def test_redhat
|
|
|
|
describe package('php') do
|
|
|
|
it { should be_installed }
|
2019-06-26 01:34:51 +02:00
|
|
|
end
|
2019-09-04 01:12:28 +02:00
|
|
|
end
|
2019-06-26 01:34:51 +02:00
|
|
|
|
2019-09-04 01:12:28 +02:00
|
|
|
def test_suse
|
2019-09-05 22:58:05 +02:00
|
|
|
describe package('php7') do
|
2019-09-04 01:12:28 +02:00
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
case os[:family]
|
|
|
|
when 'debian'
|
2019-09-04 02:58:06 +02:00
|
|
|
test_debian
|
2019-09-04 01:12:28 +02:00
|
|
|
when 'redhat', 'fedora'
|
|
|
|
test_redhat
|
|
|
|
when 'suse'
|
|
|
|
test_suse
|
2019-06-26 01:34:51 +02:00
|
|
|
end
|
|
|
|
end
|