예제 #1
0
 public function test_directory_sorted()
 {
     $pwe = new UnitTestPWECore();
     $pwe->setURL('/');
     $tmp = $pwe->getTempDirectory();
     $pwe->setRootDirectory($tmp);
     $pwe->setTempDirectory($tmp);
     PWELogger::info("Create dir " . $tmp);
     file_put_contents($tmp . '/first', time());
     file_put_contents($tmp . '/second', time());
     PWELogger::debug("File 1 " . file_get_contents($tmp . '/first'));
     PWELogger::debug("File 2 " . file_get_contents($tmp . '/second'));
     $node =& $pwe->getNode();
     $node['!a']['files_base'] = '.';
     $obj = new FileDownloads($pwe);
     $res = $obj->getDirectoryBlock('.');
     PWELogger::debug("DIR: " . $res);
     $this->assertGreaterThan(strpos($res, 'second'), strpos($res, 'first'));
 }
예제 #2
0
 public function testProcess_github_small()
 {
     $PWE = new UnitTestPWECore();
     $PWE->setStructFile(__DIR__ . '/SimpleWiki.xml');
     $PWE->setURL('/github/GitHubMarkdownSmall/');
     $node =& $PWE->getNode();
     $node['!i']['wiki_dir'] = __DIR__;
     $obj = new SimpleWiki($PWE);
     $obj->process();
     $content = $PWE->getContent();
     PWELogger::debug("Rendered: %s", $content);
 }