| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function testClearCache() |
||
| 37 | { |
||
| 38 | $indexableService = IndexableService::singleton(); |
||
| 39 | |||
| 40 | $page = SiteTree::create(); |
||
| 41 | $page->CanViewType = 'Anyone'; |
||
| 42 | $page->ShowInSearch = 0; |
||
| 43 | $page->write(); |
||
| 44 | $this->assertFalse($indexableService->isIndexable($page)); |
||
| 45 | |||
| 46 | // test the results are cached (expect stale result) |
||
| 47 | $page->ShowInSearch = 1; |
||
| 48 | $page->write(); |
||
| 49 | $this->assertFalse($indexableService->isIndexable($page)); |
||
| 50 | |||
| 51 | // after clearing cache, expect fresh result |
||
| 52 | $indexableService->clearCache(); |
||
| 53 | $this->assertTrue($indexableService->isIndexable($page)); |
||
| 54 | } |
||
| 56 |