SmsFrameworkUserMenuLinksTest.php in SMS Framework 8
File
modules/sms_user/tests/src/Functional/SmsFrameworkUserMenuLinksTest.php
View source
<?php
namespace Drupal\Tests\sms_user\Functional;
use Drupal\Tests\sms\Functional\SmsFrameworkBrowserTestBase;
use Drupal\Core\Url;
class SmsFrameworkUserMenuLinksTest extends SmsFrameworkBrowserTestBase {
public static $modules = [
'sms_user',
];
protected function setUp() {
parent::setUp();
$user = $this
->drupalCreateUser([
'access administration pages',
'administer smsframework',
]);
$this
->drupalLogin($user);
}
public function testDynamicMenuLinks() {
entity_get_form_display('user', 'user', 'default')
->save();
$this
->createPhoneNumberSettings('user', 'user');
$this
->drupalGet(Url::fromRoute('user.admin_index'));
$this
->assertLink('User phone number');
}
public function testNoDynamicMenuLinks() {
$this
->drupalGet(Url::fromRoute('user.admin_index'));
$this
->assertNoLink('User phone number');
}
}