Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Drupal\Tests\config\Functional; use Drupal\Tests\BrowserTestBase; use Dr..
Decoded Output download
<?php
namespace Drupal\Tests\config\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;
/**
* Tests draggable list builder.
*
* @group config
*/
class ConfigDraggableListBuilderTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['config_test'];
/**
* Test draggable lists.
*/
public function testDraggableList() {
$this->drupalLogin($this->drupalCreateUser(['administer permissions']));
// Create more than 50 roles.
for ($i = 0; $i < 51; $i++) {
$role = Role::create([
'id' => 'role_' . $i,
'label' => "Role $i",
]);
$role->save();
}
// Navigate to Roles page
$this->drupalGet('admin/people/roles');
// Test for the page title.
$this->assertSession()->titleEquals(t('Roles') . ' | Drupal');
// Count the number of rows in table.
$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");
}
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Drupal\Tests\config\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;
/**
* Tests draggable list builder.
*
* @group config
*/
class ConfigDraggableListBuilderTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['config_test'];
/**
* Test draggable lists.
*/
public function testDraggableList() {
$this->drupalLogin($this->drupalCreateUser(['administer permissions']));
// Create more than 50 roles.
for ($i = 0; $i < 51; $i++) {
$role = Role::create([
'id' => 'role_' . $i,
'label' => "Role $i",
]);
$role->save();
}
// Navigate to Roles page
$this->drupalGet('admin/people/roles');
// Test for the page title.
$this->assertSession()->titleEquals(t('Roles') . ' | Drupal');
// Count the number of rows in table.
$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");
}
}
}
Function Calls
None |
Stats
MD5 | f08defb1d38b7a1b2be3352ca3e67a8b |
Eval Count | 0 |
Decode Time | 78 ms |