Skip to content

Commit

Permalink
Add tests for flavor zend
Browse files Browse the repository at this point in the history
  • Loading branch information
jbh committed Jan 9, 2023
1 parent c7bfd00 commit 645cfe9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ fixtures:
yumrepo_core:
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
puppet_version: ">= 6.0.0"
zend_common: "https://github.com/zendtech/puppet-zend-common.git"
34 changes: 34 additions & 0 deletions spec/classes/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,40 @@
it { is_expected.not_to contain_class('php::composer') }
end

if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS' || facts[:osfamily] == 'Debian'
describe 'when called with flavor zend' do
zendphp_cli_package = case facts[:os]['name']
when 'Debian', 'Ubuntu'
'php8.1-zend-cli'
when 'RedHat', 'CentOS'
'php81zend-php-cli'
end
zendphp_fpm_package = case facts[:os]['name']
when 'Debian', 'Ubuntu'
'php8.1-zend-fpm'
when 'RedHat', 'CentOS'
'php81zend-php-fpm'
end
zendphp_dev_package = case facts[:os]['name']
when 'Debian', 'Ubuntu'
'php8.1-zend-dev'
when 'RedHat', 'CentOS'
'php81zend-php-dev'
end

let(:pre_condition) do
"class {'::php::globals':
php_version => '8.1',
flavor => 'zend'
}"
end

it { is_expected.to contain_class('zend_common::repo') }
it { is_expected.to contain_package(zendphp_cli_package).with_ensure('present') }
it { is_expected.to contain_package(zendphp_fpm_package).with_ensure('present') }
end
end

if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS'
describe 'when called with valid settings parameter types' do
let(:params) do
Expand Down

0 comments on commit 645cfe9

Please sign in to comment.