function BlockContentListTest::testBlockRegionPlacement

Same name and namespace in other branches
  1. 10 core/modules/block_content/tests/src/Functional/BlockContentListTest.php \Drupal\Tests\block_content\Functional\BlockContentListTest::testBlockRegionPlacement()

Tests the region value when a new block is saved.

File

core/modules/block_content/tests/src/Functional/BlockContentListTest.php, line 77

Class

BlockContentListTest
Tests the listing of content blocks.

Namespace

Drupal\Tests\block_content\Functional

Code

public function testBlockRegionPlacement() : void {
    $this->drupalLogin($this->drupalCreateUser($this->permissions));
    $this->drupalGet("admin/structure/block/library/stark", [
        'query' => [
            'region' => 'content',
        ],
    ]);
    $this->clickLink('Add content block');
    $this->assertSession()
        ->statusCodeEquals(200);
    $edit = [
        'info[0][value]' => 'foo',
    ];
    $this->submitForm($edit, 'Save');
    $this->assertSession()
        ->fieldValueEquals('region', 'content');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.