Skip to content
Snippets Groups Projects
Commit 0572700e authored by Michael Hamann's avatar Michael Hamann
Browse files

Indexer: Add test case for the PID functions

parent 03aafe1c
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Tests the pid functions of the indexer.
*
* @author Michael Hamann <michael@content-space.de>
*/
class indexer_pid_test extends DokuWikiTest {
function test_pid() {
$indexer = idx_get_indexer();
$syntaxPID = $indexer->getPID('wiki:syntax');
$this->assertEquals('wiki:syntax', $indexer->getPageFromPID($syntaxPID), 'getPageFromPID(getPID(\'wiki:syntax\')) != \'wiki:syntax\'');
$dokuwikiPID = $indexer->getPID('wiki:dokuwiki');
$this->assertEquals('wiki:syntax', $indexer->getPageFromPID($syntaxPID), 'getPageFromPID(getPID(\'wiki:syntax\')) != \'wiki:syntax\' after getting the PID for wiki:dokuwiki');
$this->assertEquals($syntaxPID, $indexer->getPID('wiki:syntax'), 'getPID(\'wiki:syntax\') didn\'t returned different PIDs when called twice');
$this->assertNotEquals($syntaxPID, $dokuwikiPID, 'Same PID returned for different pages');
$this->assertTrue(is_numeric($syntaxPID) && is_numeric($dokuwikiPID), 'PIDs are not numeric');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment