TrackerRecentContentLinkTest.php in Drupal 10
File
core/modules/tracker/tests/src/Functional/TrackerRecentContentLinkTest.php
View source
<?php
namespace Drupal\Tests\tracker\Functional;
use Drupal\Tests\BrowserTestBase;
class TrackerRecentContentLinkTest extends BrowserTestBase {
protected static $modules = [
'block',
'tracker',
];
protected $defaultTheme = 'stark';
public function testRecentContentLink() {
$this
->drupalGet('<front>');
$this
->assertSession()
->linkNotExists('Recent content');
$this
->drupalPlaceBlock('system_menu_block:tools');
$user = $this
->drupalCreateUser();
$this
->drupalLogin($user);
$this
->drupalGet('<front>');
$this
->assertSession()
->elementsCount('xpath', '//ul/li/a[contains(@href, "/activity") and text()="Recent content"]', 1);
}
}