You are here

public function BlockRepositoryTest::providerBlocksConfig in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block/tests/src/Unit/BlockRepositoryTest.php \Drupal\Tests\block\Unit\BlockRepositoryTest::providerBlocksConfig()

File

core/modules/block/tests/src/Unit/BlockRepositoryTest.php, line 118
Contains \Drupal\Tests\block\Unit\BlockRepositoryTest.

Class

BlockRepositoryTest
@coversDefaultClass \Drupal\block\BlockRepository @group block

Namespace

Drupal\Tests\block\Unit

Code

public function providerBlocksConfig() {
  $blocks_config = array(
    'block1' => array(
      AccessResult::allowed(),
      'top',
      0,
    ),
    // Test a block without access.
    'block2' => array(
      AccessResult::forbidden(),
      'bottom',
      0,
    ),
    // Test some blocks in the same region with specific weight.
    'block4' => array(
      AccessResult::allowed(),
      'bottom',
      5,
    ),
    'block3' => array(
      AccessResult::allowed(),
      'bottom',
      5,
    ),
    'block5' => array(
      AccessResult::allowed(),
      'bottom',
      -5,
    ),
  );
  $test_cases = [];
  $test_cases[] = [
    $blocks_config,
    [
      'top' => [
        'block1',
      ],
      'center' => [],
      'bottom' => [
        'block5',
        'block3',
        'block4',
      ],
    ],
  ];
  return $test_cases;
}