mirror of
https://github.com/php/phd.git
synced 2026-03-24 07:02:07 +01:00
* Refactor Options Parser and default Options Handler Refactor default Options Handler to accept dependencies through its constructor. Refactor default Options Handler to return an array of options instead of directly setting options in Config and declare array return types. Refactor method in Options Parser to return an array of options and declare its return type as array. Inject all necessary dependencies in render.php. Refactor two methods in default Options Handler by using match expressions. * Minor refactor of files used in tests Inlcude Config with require_once instead of require in Autloader. Define __INSTALLDIR__ only if it is not defined yet in render.php. Include Autoloader and functions.php with require_once instead of require. Remove unnecessary __PHPDIR__ constant, correct path for __INSTALLDIR__ and use that constant in setup.php. * Remove var_dump from Options Parser * Fix inconsistent option flags in default Option Handler * Add default Options Handler tests --------- Co-authored-by: haszi <haszika80@gmail.com>
23 lines
555 B
PHP
23 lines
555 B
PHP
--TEST--
|
|
Default options handler 008 - Save config (long option) and quit (long option)
|
|
--ARGS--
|
|
--docbook tests/options/default_handler_008.phpt --saveconfig --quit
|
|
--SKIPIF--
|
|
<?php
|
|
if (file_exists(__DIR__ . "/../../phd.config.php")) {
|
|
die("Skipped: existing phd.config.php file will overwrite command line options.");
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
namespace phpdotnet\phd;
|
|
|
|
require_once __DIR__ . "/../../render.php";
|
|
?>
|
|
--CLEAN--
|
|
<?php
|
|
unlink(__DIR__ . "/../../phd.config.php");
|
|
?>
|
|
--EXPECTF--
|
|
%s[%d:%d:%d - Heads up ]%s Writing the config file
|