Skip to content

Commit

Permalink
tests: Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philipsorst committed Feb 22, 2024
1 parent 37cf669 commit 95f8793
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Menu/Bootstrap5ButtonListRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Dontdrinkandroot\BootstrapBundle\Menu;

use Dontdrinkandroot\BootstrapBundle\Model\ItemExtra;
use Knp\Menu\ItemInterface;
use Knp\Menu\Matcher\MatcherInterface;
use Override;
Expand Down Expand Up @@ -38,7 +37,7 @@ private function renderButton(ItemInterface $item, array $options): string
if ($item->hasChildren()) {
$item->setAttribute(
'class',
$this->mergeClassesToString(['btn', 'dropdown-toggle', 'ddr-no-caret'], $item->getAttribute('class'))
$this->mergeClassesToString(['btn', 'dropdown-toggle'], $item->getAttribute('class'))
);
$item->setAttribute('data-bs-toggle', 'dropdown');
$item->setAttribute('aria-expanded', 'false');
Expand Down
2 changes: 1 addition & 1 deletion tests/Acceptance/DropdownMenuActionTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Acceptance;
namespace Dontdrinkandroot\BootstrapBundle\Tests\Acceptance;

use Dontdrinkandroot\BootstrapBundle\Tests\TestApp\Model\RoutePath;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
use Twig\Environment;

#[Route(path: RoutePath::BUTTON_GROUP, name: RouteName::BUTTON_GROUP)]
class ButtonGroupAction extends AbstractController
class ButtonListAction extends AbstractController
{
public function __invoke(Request $request): Response
{
/** @var Environment $twig */
$twig = $this->container->get('twig');
return new Response(
$twig->createTemplate(
"{{ knp_menu_render('ddr.bootstrap.test.button_group', {}, 'ddr_bootstrap5_button_group') }}"
"{{ knp_menu_render('ddr.bootstrap.test.button_list', {}, 'ddr_bootstrap5_button_list') }}"
)->render()
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestApp/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
->tag('knp_menu.menu_builder', ['method' => 'createNavbarMenu', 'alias' => 'ddr.bootstrap.test.navbar'])
->tag(
'knp_menu.menu_builder',
['method' => 'createButtonGroupMenu', 'alias' => 'ddr.bootstrap.test.button_group']
['method' => 'createButtonGroupMenu', 'alias' => 'ddr.bootstrap.test.button_list']
);
};

0 comments on commit 95f8793

Please sign in to comment.