protected function cleanupPublic() { $pagePaths = $this->listScPagesPaths(); foreach ($pagePaths as $pagePath) { $page = new Page($this->fs->read($pagePath)); $page->removePageId(); $page->cleanupContainerNames(); $page->removeMetadata(); $page->unprefixResourceUrls($this->draftBaseUrl()); $this->fs->update($pagePath, (string) $page); } }
function test_removePageId() { $html = '<html><head>' . '<meta name="application-name" content="sitecake" data-pageid="1234567890abcdefgh"/>' . '</head><body>' . '</body></html>'; $page = new Page($html); $page->removePageId(); $o = phpQuery::newDocument((string) $page); $this->assertEquals(0, phpQuery::pq('meta[data-pageid]')->count()); $this->assertEquals(1, phpQuery::pq("meta[content='sitecake']")->count()); $html = '<html><head>' . '<meta name="application-name" content="app"/>' . '</head><body>' . '</body></html>'; $page = new Page($html); $page->removePageId(); $o = phpQuery::newDocument((string) $page); $this->assertEquals(1, phpQuery::pq("meta[content='app']")->count()); }