|
@@ 24-36 (lines=13) @@
|
| 21 |
|
SiteTree::class => array(SiteTreePublishingEngine::class), |
| 22 |
|
); |
| 23 |
|
|
| 24 |
|
public function testExcludeFromCacheExcludesPageURLs() { |
| 25 |
|
/** @var URLArrayObject $urlArrayObject */ |
| 26 |
|
$urlArrayObject = singleton('SiteTree')->urlArrayObject; |
| 27 |
|
$method = $this->getProtectedOrPrivateMethod('excludeFromCache'); |
| 28 |
|
|
| 29 |
|
/** @var SiteTree $excluded */ |
| 30 |
|
$excluded = $this->objFromFixture(URLArrayObjectTestPage::class, 'excluded'); |
| 31 |
|
/** @var SiteTree $included */ |
| 32 |
|
$included = $this->objFromFixture(URLArrayObjectTestPage::class, 'included'); |
| 33 |
|
|
| 34 |
|
$this->assertTrue($method->invoke($urlArrayObject, $excluded->Link())); |
| 35 |
|
$this->assertFalse($method->invoke($urlArrayObject, $included->Link())); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function testExcludeFromCacheExcludesPageURLsWithQueryStrings() { |
| 39 |
|
/** @var URLArrayObject $urlArrayObject */ |
|
@@ 38-50 (lines=13) @@
|
| 35 |
|
$this->assertFalse($method->invoke($urlArrayObject, $included->Link())); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function testExcludeFromCacheExcludesPageURLsWithQueryStrings() { |
| 39 |
|
/** @var URLArrayObject $urlArrayObject */ |
| 40 |
|
$urlArrayObject = SiteTree::singleton()->urlArrayObject; |
| 41 |
|
$method = $this->getProtectedOrPrivateMethod('excludeFromCache'); |
| 42 |
|
|
| 43 |
|
/** @var SiteTree $excluded */ |
| 44 |
|
$excluded = $this->objFromFixture(URLArrayObjectTestPage::class, 'excluded'); |
| 45 |
|
/** @var SiteTree $included */ |
| 46 |
|
$included = $this->objFromFixture(URLArrayObjectTestPage::class, 'included'); |
| 47 |
|
|
| 48 |
|
$this->assertTrue($method->invoke($urlArrayObject, $excluded->Link() . '?query=string')); |
| 49 |
|
$this->assertFalse($method->invoke($urlArrayObject, $included->Link() . '?query=string')); |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
public function testExcludeFromCachePrefersObjectAnnotationOverUrls() { |
| 53 |
|
/** @var URLArrayObject $urlArrayObject */ |