class RoleTest
Same name in this branch
- 9 core/modules/jsonapi/tests/src/Functional/RoleTest.php \Drupal\Tests\jsonapi\Functional\RoleTest
- 9 core/modules/user/tests/src/Kernel/Plugin/migrate/source/d7/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d7\RoleTest
Same name and namespace in other branches
- 11.x core/modules/jsonapi/tests/src/Functional/RoleTest.php \Drupal\Tests\jsonapi\Functional\RoleTest
- 11.x core/modules/user/tests/src/Kernel/Plugin/migrate/source/d6/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d6\RoleTest
- 11.x core/modules/user/tests/src/Kernel/Plugin/migrate/source/d7/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d7\RoleTest
- 10 core/modules/jsonapi/tests/src/Functional/RoleTest.php \Drupal\Tests\jsonapi\Functional\RoleTest
- 10 core/modules/user/tests/src/Kernel/Plugin/migrate/source/d6/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d6\RoleTest
- 10 core/modules/user/tests/src/Kernel/Plugin/migrate/source/d7/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d7\RoleTest
- 8.9.x core/modules/jsonapi/tests/src/Functional/RoleTest.php \Drupal\Tests\jsonapi\Functional\RoleTest
- 8.9.x core/modules/user/tests/src/Kernel/Plugin/migrate/source/d6/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d6\RoleTest
- 8.9.x core/modules/user/tests/src/Kernel/Plugin/migrate/source/d7/RoleTest.php \Drupal\Tests\user\Kernel\Plugin\migrate\source\d7\RoleTest
Tests the d6_user_role source plugin.
@covers \Drupal\user\Plugin\migrate\source\d6\Role
@group user
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase extends \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase
- class \Drupal\Tests\user\Kernel\Plugin\migrate\source\d6\RoleTest extends \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase extends \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of RoleTest
File
-
core/
modules/ user/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d6/ RoleTest.php, line 13
Namespace
Drupal\Tests\user\Kernel\Plugin\migrate\source\d6View source
class RoleTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'user',
'migrate_drupal',
];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [
[
'source_data' => [],
'expected_data' => [],
],
];
$roles = [
[
'rid' => 1,
'name' => 'anonymous user',
'permissions' => [
'access content',
],
],
[
'rid' => 2,
'name' => 'authenticated user',
'permissions' => [
'access comments',
'access content',
'post comments',
'post comments without approval',
],
],
[
'rid' => 3,
'name' => 'administrator',
'permissions' => [
'access comments',
'administer comments',
'post comments',
'post comments without approval',
'access content',
'administer content types',
'administer nodes',
],
],
];
// The source data.
foreach ($roles as $role) {
$tests[0]['source_data']['permission'][] = [
'rid' => $role['rid'],
'perm' => implode(', ', $role['permissions']),
];
unset($role['permissions']);
$tests[0]['source_data']['role'][] = $role;
}
$tests[0]['source_data']['filter_formats'] = [
[
'format' => 1,
'roles' => '',
],
];
// The expected results.
$tests[0]['expected_data'] = $roles;
return $tests;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.