diff --git a/src/Service/Ui.php b/src/Service/Ui.php index c542f12..e9b2d78 100644 --- a/src/Service/Ui.php +++ b/src/Service/Ui.php @@ -172,6 +172,11 @@ public static function serverRequest(): ServerRequestInterface } public static function getQueryParamValue(string $param): ?string + { + return static::service()->returnQueryParamValue($param); + } + + protected function returnQueryParamValue(string $param): ?string { $params = []; parse_str(static::service()->serverRequest()->getUri()->getQuery(), $params); diff --git a/tests/Callback/CallbackTest.php b/tests/Callback/CallbackTest.php index 48d57a7..a59f1f9 100644 --- a/tests/Callback/CallbackTest.php +++ b/tests/Callback/CallbackTest.php @@ -16,13 +16,14 @@ use Fohn\Ui\HtmlTemplate; use Fohn\Ui\Js\Js; use Fohn\Ui\Service\Ui; +use Fohn\Ui\Tests\UiTestService; use Fohn\Ui\View; class CallbackTest extends \PHPUnit\Framework\TestCase { protected function setUp(): void { - $ui = Ui::service(); + $ui = UiTestService::service(); $ui->setApp(new MockApp(['registerShutdown' => false])); } diff --git a/tests/Callback/init-test-callback-ui.php b/tests/Callback/init-test-callback-ui.php index 50c4e72..a0fb1ef 100644 --- a/tests/Callback/init-test-callback-ui.php +++ b/tests/Callback/init-test-callback-ui.php @@ -27,7 +27,7 @@ Data::setDb($config['db']); $ui->environment = $config['env']; - $ui->displayformat = $config['format']; + $ui->setDisplayFormat($config['format']); $ui->timezone($config['timezone']); $ui->setApp($app); diff --git a/tests/UiTestService.php b/tests/UiTestService.php new file mode 100644 index 0000000..f75703a --- /dev/null +++ b/tests/UiTestService.php @@ -0,0 +1,18 @@ +