Skip to content

Commit

Permalink
adjust namespaces and version changes
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Nov 15, 2024
1 parent 3eb768a commit 1c1c627
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Util/BackendUiUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions tests/Util/BackendUiUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);

Expand Down

0 comments on commit 1c1c627

Please sign in to comment.