Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
AddTypeTester
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace HtaccessCapabilityTester\Testers;
4
5/**
6 * Class for testing if AddType works
7 *
8 * @package    HtaccessCapabilityTester
9 * @author     Bjørn Rosell <it@rosell.dk>
10 * @since      Class available since 0.7
11 */
12class AddTypeTester extends CustomTester
13{
14
15    /**
16     * Constructor.
17     *
18     * @return void
19     */
20    public function __construct()
21    {
22        $htaccessFile = <<<'EOD'
23<IfModule mod_mime.c>
24    AddType image/gif .test
25</IfModule>
26EOD;
27
28        $test = [
29            'subdir' => 'add-type',
30            'files' => [
31                ['.htaccess', $htaccessFile],
32                ['request-me.test', 'hi'],
33            ],
34            'request' => 'request-me.test',
35            'interpretation' => [
36                ['success', 'headers', 'contains-key-value', 'Content-Type', 'image/gif'],
37                ['inconclusive', 'status-code', 'not-equals', '200'],
38                ['failure', 'headers', 'not-contains-key-value', 'Content-Type', 'image/gif'],
39            ]
40        ];
41
42        parent::__construct($test);
43    }
44}