Skip to content

Commit

Permalink
fix test BambooTwigRenderTest::testMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Feb 20, 2024
1 parent 05b222e commit 79e52b6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/src/Functional/BambooTwigRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,13 @@ public function testMenu() {
$this->assertSession()->elementExists('css', '.test-render div.render-menu-all');
$this->assertElementCount('ul', 9, '.test-render div.render-menu-all');

// Since Drupal 10.1.x the default Drupal distribution have 26 menu items.
if (version_compare(\Drupal::VERSION, '10.1', '>=')) {
$this->assertElementCount('li', 28, '.test-render div.render-menu-all');
// Since Drupal 10.2.x the default Drupal distribution have X menu items.
if (version_compare(\Drupal::VERSION, '10.2', '>=')) {
$this->assertElementCount('li', 24, '.test-render div.render-menu-all');
}
// Since Drupal 10.1.x the default Drupal distribution have X menu items.
elseif (version_compare(\Drupal::VERSION, '10.1', '>=')) {
$this->assertElementCount('li', 29, '.test-render div.render-menu-all');
}
else {
$this->assertElementCount('li', 27, '.test-render div.render-menu-all');
Expand All @@ -467,9 +471,9 @@ public function testMenu() {
$this->assertSession()->elementExists('css', '.test-render div.render-menu-level');
$this->assertElementCount('ul', 8, '.test-render div.render-menu-level');

// Since Drupal 10.1.x the default Drupal distribution have 25 menu items.
// Since Drupal 10.1.x the default Drupal distribution have X menu items.
if (version_compare(\Drupal::VERSION, '10.1', '>=')) {
$this->assertElementCount('li', 27, '.test-render div.render-menu-level');
$this->assertElementCount('li', 28, '.test-render div.render-menu-level');
}
else {
$this->assertElementCount('li', 26, '.test-render div.render-menu-level');
Expand Down

0 comments on commit 79e52b6

Please sign in to comment.