public function BlockRepositoryTest::providerBlocksConfig in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block/tests/src/Unit/BlockRepositoryTest.php \Drupal\Tests\block\Unit\BlockRepositoryTest::providerBlocksConfig()
- 9 core/modules/block/tests/src/Unit/BlockRepositoryTest.php \Drupal\Tests\block\Unit\BlockRepositoryTest::providerBlocksConfig()
File
- core/
modules/ block/ tests/ src/ Unit/ BlockRepositoryTest.php, line 113
Class
- BlockRepositoryTest
- @coversDefaultClass \Drupal\block\BlockRepository @group block
Namespace
Drupal\Tests\block\UnitCode
public function providerBlocksConfig() {
$blocks_config = [
'block1' => [
AccessResult::allowed(),
'top',
0,
],
// Test a block without access.
'block2' => [
AccessResult::forbidden(),
'bottom',
0,
],
// Test some blocks in the same region with specific weight.
'block4' => [
AccessResult::allowed(),
'bottom',
5,
],
'block3' => [
AccessResult::allowed(),
'bottom',
5,
],
'block5' => [
AccessResult::allowed(),
'bottom',
-5,
],
];
$test_cases = [];
$test_cases[] = [
$blocks_config,
[
'top' => [
'block1',
],
'center' => [],
'bottom' => [
'block5',
'block3',
'block4',
],
],
];
return $test_cases;
}