TrackerRecentContentLinkTest.php in Drupal 8
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>');
$link = $this
->xpath('//ul/li/a[contains(@href, :href) and text()=:text]', [
':menu_class' => 'menu-item',
':href' => '/activity',
':text' => 'Recent content',
]);
$this
->assertCount(1, $link);
}
}