Saltstack Official PHP Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.2KB

  1. # frozen_string_literal: true
  2. control 'Php package' do
  3. title 'should be installed'
  4. # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
  5. def test_debian
  6. describe package('php-imagick') do
  7. it { should be_installed }
  8. end
  9. describe package('php-xdebug') do
  10. it { should be_installed }
  11. end
  12. %w[
  13. bz2 cli curl fpm gd imap intl mbstring
  14. mysql readline redis xml zip
  15. ].each do |pkg|
  16. describe package("php5.6-#{pkg}") do
  17. it { should be_installed }
  18. end
  19. describe package("php7.3-#{pkg}") do
  20. it { should be_installed }
  21. end
  22. end
  23. end
  24. # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
  25. def test_redhat
  26. describe package('php') do
  27. it { should be_installed }
  28. end
  29. end
  30. def test_suse
  31. describe package('php7') do
  32. it { should be_installed }
  33. end
  34. end
  35. def test_bsd
  36. %w[
  37. php74 php74-filter php74-json php74-mbstring php74-openssl php74-phar
  38. ].each do |pkg|
  39. describe package(pkg) do
  40. it { should be_installed }
  41. end
  42. end
  43. end
  44. case os[:family]
  45. when 'debian'
  46. test_debian
  47. when 'redhat', 'fedora'
  48. test_redhat
  49. when 'suse'
  50. test_suse
  51. when 'bsd'
  52. test_bsd
  53. end
  54. end