diff --git a/.gitignore b/.gitignore index 2d7e728e..efae396c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ run-tests.php **/tests/**/*.diff **/tests/**/*.out* **/tests/**/*.php +!tests/helpers.php **/tests/**/*.exp **/tests/**/*.log **/tests/**/*.sh diff --git a/phpdotnet/phd/Package/PHP/Web.php b/phpdotnet/phd/Package/PHP/Web.php index 475f3870..30734ef7 100644 --- a/phpdotnet/phd/Package/PHP/Web.php +++ b/phpdotnet/phd/Package/PHP/Web.php @@ -201,7 +201,7 @@ public function header($id) { "up" => $up, "prev" => $prev, "next" => $next, - "alternatives" => $this->cchunk["alternatives"], + "alternatives" => $this->cchunk["alternatives"] ?? [], "source" => $this->sourceInfo($id), ); $history = $this->history ?? []; diff --git a/tests/GH-225.phpt b/tests/GH-225.phpt index e8049cab..36e9a5d4 100644 --- a/tests/GH-225.phpt +++ b/tests/GH-225.phpt @@ -8,9 +8,8 @@ all isDir() ? \rmdir($file->getPathname()) : \unlink($file->getPathname()); -} -\rmdir(__DIR__ . "/../output/"); + +require_once __DIR__ . "/helpers.php"; +\phpdotnet\phd\removeOutputFolder(); ?> --EXPECTF-- %s[%d:%d:%d - Heads up ]%s Loaded config from existing file diff --git a/tests/helpers.php b/tests/helpers.php new file mode 100644 index 00000000..d1f94441 --- /dev/null +++ b/tests/helpers.php @@ -0,0 +1,26 @@ +isDir() ? \rmdir($file->getPathname()) : \unlink($file->getPathname()); + } + \rmdir($folder); +} diff --git a/tests/options/default_handler_007.phpt b/tests/options/default_handler_007.phpt index 88ee071b..8978bc5a 100644 --- a/tests/options/default_handler_007.phpt +++ b/tests/options/default_handler_007.phpt @@ -2,6 +2,8 @@ Default options handler 007 - Save config (short option) and quit (short option) --ARGS-- --docbook tests/options/default_handler_007.phpt -S -Q +--CONFLICTS-- +all --SKIPIF-- --CLEAN-- --EXPECTF-- %s[%d:%d:%d - Heads up ]%s Writing the config file diff --git a/tests/options/default_handler_008.phpt b/tests/options/default_handler_008.phpt index 27322cd6..607dee5a 100644 --- a/tests/options/default_handler_008.phpt +++ b/tests/options/default_handler_008.phpt @@ -14,11 +14,17 @@ if (file_exists(__DIR__ . "/../../phd.config.php")) { --CLEAN-- --EXPECTF-- %s[%d:%d:%d - Heads up ]%s Writing the config file diff --git a/tests/render/data/sources.xml b/tests/render/data/sources.xml new file mode 100644 index 00000000..4c8224ad --- /dev/null +++ b/tests/render/data/sources.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/render/data/version.xml b/tests/render/data/version.xml new file mode 100644 index 00000000..9282da17 --- /dev/null +++ b/tests/render/data/version.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/render/en/entities/entities.acronyms.ent b/tests/render/en/entities/entities.acronyms.ent new file mode 100644 index 00000000..50bad95b --- /dev/null +++ b/tests/render/en/entities/entities.acronyms.ent @@ -0,0 +1,9 @@ + + + + +Application Programming Interface + + diff --git a/tests/render/render_001.phpt b/tests/render/render_001.phpt index 1cf162be..e6aa519b 100644 --- a/tests/render/render_001.phpt +++ b/tests/render/render_001.phpt @@ -2,26 +2,21 @@ Render 001 - Smoke test render.php --ARGS-- --memoryindex --forceindex --package PHP --format php --docbook tests/render/data/render_001.xml +--CONFLICTS-- +all --FILE-- --CLEAN-- isDir() ? \rmdir($file->getPathname()) : \unlink($file->getPathname()); -} -\rmdir(__DIR__ . "/../../output/"); +require_once __DIR__ . "/../helpers.php"; +\phpdotnet\phd\removeOutputFolder(); ?> --EXPECTF-- %s[%d:%d:%d - Indexing ]%s Indexing...