ModulesListFormWebTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Form/ModulesListFormWebTest.php
View source
<?php
namespace Drupal\system\Tests\Form;
use Drupal\simpletest\WebTestBase;
class ModulesListFormWebTest extends WebTestBase {
public static $modules = array(
'system_test',
'help',
);
protected function setUp() {
parent::setUp();
\Drupal::state()
->set('system_test.module_hidden', FALSE);
}
public function testModuleListForm() {
$this
->drupalLogin($this
->drupalCreateUser(array(
'administer modules',
'administer permissions',
)));
$this
->drupalGet('admin/modules');
$this
->assertResponse('200');
$this
->assertFieldByXPath("//a[contains(@href, '/system-test/configure/bar') and text()='Configure ']/span[contains(@class, 'visually-hidden') and text()='the System test module']");
$this
->assertFieldByXPath("//a[contains(@href, '/admin/people/permissions#module-system_test') and @title='Configure permissions']");
$this
->assertFieldByXPath("//a[contains(@href, '/admin/help/system_test') and @title='Help']");
$this
->assertText('simpletest');
}
}