@@ 14-24 (lines=11) @@ | ||
11 | class ModifiedSinceTest extends TestCase |
|
12 | { |
|
13 | ||
14 | public function testGetValue() |
|
15 | { |
|
16 | $stack = new RequestStack(); |
|
17 | $request = new Request(); |
|
18 | $date = new \DateTime('2018-06-01'); |
|
19 | $request->headers->set('If-Modified-Since', $date->format(\DATE_RSS)); |
|
20 | $stack->push($request); |
|
21 | ||
22 | $modifiedSince = new ModifiedSince($stack, new NullLogger()); |
|
23 | $this->assertEquals($date, $modifiedSince->getValue()); |
|
24 | } |
|
25 | ||
26 | public function testGetBadValue() |
|
27 | { |
|
@@ 49-59 (lines=11) @@ | ||
46 | } |
|
47 | ||
48 | ||
49 | public function testGetValueInArray() |
|
50 | { |
|
51 | $stack = new RequestStack(); |
|
52 | $request = new Request(); |
|
53 | $date = new \DateTime('2018-06-01'); |
|
54 | $request->headers->set('If-Modified-Since', [$date->format(\DATE_RSS)]); |
|
55 | $stack->push($request); |
|
56 | ||
57 | $modifiedSince = new ModifiedSince($stack, new NullLogger()); |
|
58 | $this->assertEquals($date, $modifiedSince->getValue()); |
|
59 | } |
|
60 | ||
61 | } |
|
62 |