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