1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
--TEST--
Indexing 001 - Basic indexing
--FILE--
<?php
namespace phpdotnet\phd;
require_once __DIR__ . "/../setup.php";
$xml_file = __DIR__ . "/data/indexing_001.xml";
$config->setForce_index(true);
$config->setXml_file($xml_file);
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();
$index = new TestIndex($indexRepository, $config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, null, $index);
$render->run();
$indexes = array_keys($index->getNfo());
echo "Indexes stored:\n";
var_dump($indexes);
$changelog = array_keys($index->getChangelog());
echo "Changelog stored:\n";
var_dump($changelog);
?>
--EXPECT--
Indexes stored:
array(15) {
[0]=>
string(5) "index"
[1]=>
string(8) "bookinfo"
[2]=>
string(7) "authors"
[3]=>
string(9) "copyright"
[4]=>
string(6) "manual"
[5]=>
string(7) "preface"
[6]=>
string(12) "contributors"
[7]=>
string(13) "mongodb.setup"
[8]=>
string(20) "mongodb.requirements"
[9]=>
string(13) "chapterInBook"
[10]=>
string(12) "introduction"
[11]=>
string(12) "intro-whatis"
[12]=>
string(14) "apcu.constants"
[13]=>
string(19) "reserved.interfaces"
[14]=>
string(17) "class.traversable"
}
Changelog stored:
array(1) {
[0]=>
string(17) "class.traversable"
}
|