Skip to content

Commit 6555cf0

Browse files
committed
test(config): add tests on Php config
1 parent dc12a0b commit 6555cf0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
control 'Php configuration' do
2+
title 'should match desired lines'
3+
4+
def test_debian
5+
describe file('/etc/php/5.6/fpm/pool.d/radius-admin.conf') do
6+
its('content') { should include '[radius-admin]' }
7+
its('content') { should include 'php_admin_value[date.timezone] = Europe/Paris' }
8+
end
9+
10+
describe file('/etc/php/7.3/fpm/pool.d/ldap-admin.conf') do
11+
its('content') { should include '[ldap-admin]' }
12+
its('content') { should include 'php_admin_value[date.timezone] = Europe/Paris' }
13+
end
14+
15+
describe file('/etc/php/5.6/fpm/php.ini') do
16+
its('content') { should include 'date.timezone = Europe/Paris' }
17+
end
18+
19+
describe file('/etc/php/7.3/fpm/php.ini') do
20+
its('content') { should include 'date.timezone = Europe/Paris' }
21+
end
22+
end
23+
24+
def test_ubuntu
25+
end
26+
27+
def test_redhat
28+
end
29+
30+
def test_suse
31+
end
32+
33+
case os[:family]
34+
when 'debian'
35+
case os[:name]
36+
when 'ubuntu'
37+
test_ubuntu
38+
when 'debian'
39+
test_debian
40+
end
41+
when 'redhat', 'fedora'
42+
test_redhat
43+
when 'suse'
44+
test_suse
45+
end
46+
end

0 commit comments

Comments
 (0)