From 1c1c62792c708c449a83af3b984cab74633f681d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Fri, 15 Nov 2024 15:08:37 +0100 Subject: [PATCH] adjust namespaces and version changes --- src/Util/BackendUiUtil.php | 3 +-- src/Util/{ => Ui}/PopupWizardLinkOptions.php | 0 tests/Util/BackendUiUtilTest.php | 6 ++++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename src/Util/{ => Ui}/PopupWizardLinkOptions.php (100%) diff --git a/src/Util/BackendUiUtil.php b/src/Util/BackendUiUtil.php index c0ef4663..9dd8372f 100644 --- a/src/Util/BackendUiUtil.php +++ b/src/Util/BackendUiUtil.php @@ -5,7 +5,6 @@ use Contao\CoreBundle\Framework\ContaoFramework; use Contao\Image; use Contao\StringUtil; -use HeimrichHannot\UtilsBundle\Util\Html\HtmlUtil; use HeimrichHannot\UtilsBundle\Util\Ui\PopupWizardLinkOptions; class BackendUiUtil @@ -27,7 +26,7 @@ public function popupWizardLink(array $parameter, PopupWizardLinkOptions $option $parameter['popup'] = 1; $parameter['nb'] = 1; - $url = $this->routingUtil->generateBackendRoute($parameter, true, true, $options->route); + $url = $this->routingUtil->generateBackendRoute($parameter, true, true, ['route' => $options->route]); if ($options->urlOnly) { return $url; } diff --git a/src/Util/PopupWizardLinkOptions.php b/src/Util/Ui/PopupWizardLinkOptions.php similarity index 100% rename from src/Util/PopupWizardLinkOptions.php rename to src/Util/Ui/PopupWizardLinkOptions.php diff --git a/tests/Util/BackendUiUtilTest.php b/tests/Util/BackendUiUtilTest.php index 90c6a25b..8e5bff03 100644 --- a/tests/Util/BackendUiUtilTest.php +++ b/tests/Util/BackendUiUtilTest.php @@ -6,7 +6,7 @@ use Contao\Image; use HeimrichHannot\UtilsBundle\Tests\AbstractUtilsTestCase; use HeimrichHannot\UtilsBundle\Util\BackendUiUtil; -use HeimrichHannot\UtilsBundle\Util\Html\HtmlUtil; +use HeimrichHannot\UtilsBundle\Util\HtmlUtil; use HeimrichHannot\UtilsBundle\Util\RoutingUtil; use HeimrichHannot\UtilsBundle\Util\Ui\PopupWizardLinkOptions; use PHPUnit\Framework\MockObject\MockBuilder; @@ -26,7 +26,9 @@ public function getTestInstance(array $parameters = [], ?MockBuilder $mockBuilde public function testPopupWizardLinkReturnsCorrectUrlOnly() { $routingUtil = $this->createMock(RoutingUtil::class); - $routingUtil->method('generateBackendRoute')->willReturnArgument(3); + $routingUtil->method('generateBackendRoute')->willReturnCallback(function (array $params, bool $addToken = true, bool $addReferer = true, array $options = []) { + return $options['route'] ?? 'contao_backend'; + }); $backendUiUtil = $this->getTestInstance(['routingUtil' => $routingUtil]);