diff options
author | Anika Henke <anika@selfthinker.org> | 2012-06-29 17:51:09 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2012-06-29 17:51:09 +0100 |
commit | 0c06a181819249c6a4a2a6c60e13f739df1f2253 (patch) | |
tree | 859377c572d0acbfc520b02304ef515bf3aebbe0 /_test/cases/inc/indexer_idx_indexlengths.test.php | |
parent | ef7e36e4fd2a168977754f0aac1d855fb651f104 (diff) | |
parent | 5d0aaf958325f500ce69cfb79e69eb0d8f83fdeb (diff) | |
download | rpg-0c06a181819249c6a4a2a6c60e13f739df1f2253.tar.gz rpg-0c06a181819249c6a4a2a6c60e13f739df1f2253.tar.bz2 |
Merge branch 'master' of github.com:splitbrain/dokuwiki into frontend_improvements
Conflicts:
lib/tpl/dokuwiki/css/basic.css
Diffstat (limited to '_test/cases/inc/indexer_idx_indexlengths.test.php')
-rw-r--r-- | _test/cases/inc/indexer_idx_indexlengths.test.php | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/_test/cases/inc/indexer_idx_indexlengths.test.php b/_test/cases/inc/indexer_idx_indexlengths.test.php deleted file mode 100644 index a0f7c9224..000000000 --- a/_test/cases/inc/indexer_idx_indexlengths.test.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -require_once DOKU_INC.'inc/indexer.php'; - -class indexer_idx_indexlengths_test extends UnitTestCase { - - /** - * Test the function with an array of one value - */ - function test_oneWord(){ - global $conf; - $filter[8] = array('dokuwiki'); - // one word should return the index - $ref[] = 8; - sort($ref); - $result = idx_indexLengths(&$filter); - sort($result); - $this->assertIdentical($result, $ref); - } - - /** - * Test the function with an array of values - */ - function test_moreWords() { - global $conf; - $filter = array( 4 => array('test'), 8 => array('dokuwiki'), 7 => array('powered')); - // more words should return the indexes - $ref = array(4, 7, 8); - sort($ref); - $result = idx_indexLengths(&$filter); - sort($result); - $this->assertIdentical($result, $ref); - } - - /** - * Test a minimal value in case of wildcard search - */ - function test_minValue() { - global $conf; - $filter = 5; - // construction of the list of the index to compare - $dir = @opendir($conf['indexdir']); - $ref = array(); - while (($f = readdir($dir)) !== false) { - if (substr($f,0,1) == 'i' && substr($f,-4) == '.idx'){ - $i = substr($f,1,-4); - if (is_numeric($i) && $i >= $filter) - $ref[] = (int)$i; - } - } - closedir($dir); - sort($ref); - $result = idx_indexLengths(&$filter); - sort($result); - $this->assertIdentical($result, $ref); - } -} - - -//Setup VIM: ex: et ts=4 : |