<commit_before>require 'spec_helper'

describe 'apache::mod::php', :type => :class do
  describe "on a Debian OS" do
    let :facts do
      {
        :osfamily               => 'Debian',
        :operatingsystemrelease => '6',
        :concat_basedir         => '/dne',
        :lsbdistcodename        => 'squeeze',
        :operatingsystem        => 'Debian',
        :id                     => 'root',
        :kernel                 => 'Linux',
        :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
        :is_pe                  => false,
      }
    end
    context "with mpm_module => prefork" do
      let :pre_condition do
        'class { "apache": mpm_module => prefork, }'
      end
      it { is_expected.to contain_class("apache::params") }
      it { is_expected.to contain_class("apache::mod::prefork") }
      it { is_expected.to contain_apache__mod('php5') }
      it { is_expected.to contain_package("libapache2-mod-php5") }
      it { is_expected.to contain_file("php5.load").with(
        :content => "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n"
      ) }
    end
    context "with mpm_module => itk" do
      let :pre_condition do
        'class { "apache": mpm_module => itk, }'
      end
      it { is_expected.to contain_class("apache::params") }
      it { is_expected.to contain_class("apache::mod::itk") }
      it { is_expected.to contain_apache__mod('php5') }
      it { is_expected.to contain_package("libapache2-mod-php5") }
      it { is_expected.to contain_file("php5.load").with(<commit_msg>MODULES-2890: mod::php: Explicit test on jessie<commit_after>require 'spec_helper'

describe 'apache::mod::php', :type => :class do
  describe "on a Debian OS" do
    let :facts do
      {
        :osfamily               => 'Debian',
        :operatingsystemrelease => '6',
        :concat_basedir         => '/dne',
        :lsbdistcodename        => 'squeeze',
        :operatingsystem        => 'Debian',
        :id                     => 'root',
        :kernel                 => 'Linux',
        :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
        :is_pe                  => false,
      }
    end
    context "with mpm_module => prefork" do
      let :pre_condition do
        'class { "apache": mpm_module => prefork, }'
      end
      it { is_expected.to contain_class("apache::params") }
      it { is_expected.to contain_class("apache::mod::prefork") }
      it { is_expected.to contain_apache__mod('php5') }
      it { is_expected.to contain_package("libapache2-mod-php5") }
      it { is_expected.to contain_file("php5.load").with(
        :content => "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n"
      ) }
    end
    context "with mpm_module => itk" do
      let :pre_condition do
        'class { "apache": mpm_module => itk, }'
      end
      it { is_expected.to contain_class("apache::params") }
      it { is_expected.to contain_class("apache::mod::itk") }
      it { is_expected.to contain_apache__mod('php5') }
      it { is_expected.to contain_package("libapache2-mod-php5") }
      it { is_expected.to contain_file("php5.load").with(
        :content => "LoadModule php5_module /usr/lib/apache2/modules/libphp5.so\n"
      ) }
    end
    context "on jessie" do
      let :pre_condition do
        'class { "apache": mpm_module => prefork, }'
      end
      let(:facts) { super().merge({
        :operatingsystemrelease => '8',
        :lsbdistcodename        => 'jessie',
      }) }
      it { is_expected.to contain_file("php5.load").with(
{'fraction_non_alphanumeric': 0.14214739166436655, 'fraction_numerical': 0.009108473640629312, 'mean_word_length': 2.1706036745406823, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1978725', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1166, 'n_words': 222}