public function testQueueGetURLsOnPublish() { $page = SiteTree::create(array('URLSegment' => 'test')); $page->write(); $page->publish('Stage', 'Live'); $sc = StaticCaching::create()->publish($page); $this->assertTrue($sc instanceof StaticCaching, 'StaticCaching::publish() should return an instance of it self'); $this->assertEquals(array(CacheURL::create('/test/')), $sc->getQueue()->toArray()); }
function testGetURLs() { $page = $this->objFromFixture('SiteTree', 'news1'); $first = new CacheURL('/news/first-news/'); $sd = CacheURL::create('/news/'); $expected = new ArrayList(array($first, $sd)); $actual = $this->obj->getURLs($page); $this->assertTrue($actual instanceof ArrayList); $this->assertEquals(2, $actual->count()); $this->assertEquals($expected, $actual); }