class BlockTest
Same name in this branch
- 9 core/modules/jsonapi/tests/src/Functional/BlockTest.php \Drupal\Tests\jsonapi\Functional\BlockTest
- 9 core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php \Drupal\Tests\views\Unit\Plugin\views\display\BlockTest
- 9 core/modules/block/tests/src/Functional/BlockTest.php \Drupal\Tests\block\Functional\BlockTest
Same name and namespace in other branches
- 11.x core/modules/jsonapi/tests/src/Functional/BlockTest.php \Drupal\Tests\jsonapi\Functional\BlockTest
- 11.x core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php \Drupal\Tests\views\Unit\Plugin\views\display\BlockTest
- 11.x core/modules/block/tests/src/Kernel/Plugin/migrate/source/BlockTest.php \Drupal\Tests\block\Kernel\Plugin\migrate\source\BlockTest
- 11.x core/modules/block/tests/src/Functional/BlockTest.php \Drupal\Tests\block\Functional\BlockTest
Tests block source plugin.
@covers \Drupal\block\Plugin\migrate\source\Block
@group block
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \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 implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase implements \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase
- class \Drupal\Tests\block\Kernel\Plugin\migrate\source\BlockTest implements \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase implements \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateSourceTestBase implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of BlockTest
1 file declares its use of BlockTest
- BlockTranslationTest.php in core/
modules/ block/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d6/ BlockTranslationTest.php
File
-
core/
modules/ block/ tests/ src/ Kernel/ Plugin/ migrate/ source/ BlockTest.php, line 13
Namespace
Drupal\Tests\block\Kernel\Plugin\migrate\sourceView source
class BlockTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'block',
'migrate_drupal',
];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['blocks'] = [
[
'bid' => 1,
'module' => 'block',
'delta' => '1',
'theme' => 'garland',
'status' => 1,
'weight' => 0,
'region' => 'left',
'visibility' => 0,
'pages' => '',
'title' => 'Test Title 01',
'cache' => -1,
],
[
'bid' => 2,
'module' => 'block',
'delta' => '2',
'theme' => 'garland',
'status' => 1,
'weight' => 5,
'region' => 'right',
'visibility' => 0,
'pages' => '<front>',
'title' => 'Test Title 02',
'cache' => -1,
],
];
$tests[0]['source_data']['blocks_roles'] = [
[
'module' => 'block',
'delta' => 1,
'rid' => 2,
],
[
'module' => 'block',
'delta' => 2,
'rid' => 2,
],
[
'module' => 'block',
'delta' => 2,
'rid' => 100,
],
];
$tests[0]['source_data']['role'] = [
[
'rid' => 2,
'name' => 'authenticated user',
],
];
$tests[0]['source_data']['system'] = [
[
'filename' => 'modules/system/system.module',
'name' => 'system',
'type' => 'module',
'owner' => '',
'status' => '1',
'throttle' => '0',
'bootstrap' => '0',
'schema_version' => '6055',
'weight' => '0',
'info' => 'a:0:{}',
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'bid' => 1,
'module' => 'block',
'delta' => '1',
'theme' => 'garland',
'status' => 1,
'weight' => 0,
'region' => 'left',
'visibility' => 0,
'pages' => '',
'title' => 'Test Title 01',
'cache' => -1,
'roles' => [
2,
],
],
[
'bid' => 2,
'module' => 'block',
'delta' => '2',
'theme' => 'garland',
'status' => 1,
'weight' => 5,
'region' => 'right',
'visibility' => 0,
'pages' => '<front>',
'title' => 'Test Title 02',
'cache' => -1,
'roles' => [
2,
],
],
];
return $tests;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.