ConfigDraggableListBuilderTest.php in Drupal 8
File
core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php
View source
<?php
namespace Drupal\Tests\config\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;
class ConfigDraggableListBuilderTest extends BrowserTestBase {
public static $modules = [
'config_test',
];
protected $defaultTheme = 'stark';
public function testDraggableList() {
$this
->drupalLogin($this
->drupalCreateUser([
'administer permissions',
]));
for ($i = 0; $i < 51; $i++) {
$role = Role::create([
'id' => 'role_' . $i,
'label' => "Role {$i}",
]);
$role
->save();
}
$this
->drupalGet('admin/people/roles');
$this
->assertSession()
->titleEquals('Roles | Drupal');
$rows = $this
->xpath('//form[@class="user-admin-roles-form"]/table/tbody/tr');
$this
->assertGreaterThan(50, count($rows));
for ($i = 0; $i < 51; $i++) {
$this
->assertSession()
->pageTextContains("Role {$i}");
}
}
}