@@ 14-26 (lines=13) @@ | ||
11 | 'SiteTree' => array('SiteTreePublishingEngine') |
|
12 | ); |
|
13 | ||
14 | public function testExcludeFromCacheExcludesPageURLs() { |
|
15 | /** @var URLArrayObject $urlArrayObject */ |
|
16 | $urlArrayObject = singleton('SiteTree')->urlArrayObject; |
|
17 | $method = $this->getProtectedOrPrivateMethod('excludeFromCache'); |
|
18 | ||
19 | /** @var SiteTree $excluded */ |
|
20 | $excluded = $this->objFromFixture('URLArrayObjectTestPage', 'excluded'); |
|
21 | /** @var SiteTree $included */ |
|
22 | $included = $this->objFromFixture('URLArrayObjectTestPage', 'included'); |
|
23 | ||
24 | $this->assertEquals(true, $method->invoke($urlArrayObject, $excluded->Link())); |
|
25 | $this->assertEquals(false, $method->invoke($urlArrayObject, $included->Link())); |
|
26 | } |
|
27 | ||
28 | public function testExcludeFromCacheExcludesPageURLsWithQueryStrings() { |
|
29 | /** @var URLArrayObject $urlArrayObject */ |
|
@@ 28-40 (lines=13) @@ | ||
25 | $this->assertEquals(false, $method->invoke($urlArrayObject, $included->Link())); |
|
26 | } |
|
27 | ||
28 | public function testExcludeFromCacheExcludesPageURLsWithQueryStrings() { |
|
29 | /** @var URLArrayObject $urlArrayObject */ |
|
30 | $urlArrayObject = singleton('SiteTree')->urlArrayObject; |
|
31 | $method = $this->getProtectedOrPrivateMethod('excludeFromCache'); |
|
32 | ||
33 | /** @var SiteTree $excluded */ |
|
34 | $excluded = $this->objFromFixture('URLArrayObjectTestPage', 'excluded'); |
|
35 | /** @var SiteTree $included */ |
|
36 | $included = $this->objFromFixture('URLArrayObjectTestPage', 'included'); |
|
37 | ||
38 | $this->assertEquals(true, $method->invoke($urlArrayObject, $excluded->Link() . '?query=string')); |
|
39 | $this->assertEquals(false, $method->invoke($urlArrayObject, $included->Link() . '?query=string')); |
|
40 | } |
|
41 | ||
42 | public function testExcludeFromCachePrefersObjectAnnotationOverUrls() { |
|
43 | /** @var URLArrayObject $urlArrayObject */ |