Skip to content
Snippets Groups Projects

Issue #3315860: Change the position of the Browse tab in the local task order

Files
2
<?php
namespace Drupal\Tests\project_browser\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests Project Browser Menu tabs placement.
*
* @group project_browser
*/
class ProjectBrowserMenuTabsTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'block',
'project_browser',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->drupalLogin($this->drupalCreateUser([
'administer modules',
]));
}
/**
* Tests browse menu link.
*/
public function testBrowseMenuPosition(): void {
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalGet('admin/modules/browse');
$this->assertSession()->pageTextContains('Browse');
// Get the second tab in the nav bar.
$second_tab = $this->getSession()->getPage()->find('css', 'div:nth-child(3) li:nth-child(2)');
// Assert that the second tab is the Browse tab.
$this->assertSame('Browse(active tab)', $second_tab->getText());
}
}
Loading