Commit d0d5dd1e authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3257407 by tstoeckler, catch: Use "content" region in...

Issue #3257407 by tstoeckler, catch: Use "content" region in BlockCreationTrait::placeBlock() instead of "sidebar_first"
parent 1b02d0e6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -252,7 +252,9 @@ public function testBlock() {
    $this->assertSession()->pageTextContains('The block ' . $block['settings[label]'] . ' has been removed from the Footer region.');

    // Test deleting a block via "Configure block" link.
    $block = $this->drupalPlaceBlock('system_powered_by_block');
    $block = $this->drupalPlaceBlock('system_powered_by_block', [
      'region' => 'left_sidebar',
    ]);
    $this->drupalGet('admin/structure/block/manage/' . $block->id(), ['query' => ['destination' => 'admin']]);
    $this->clickLink('Remove block');
    $this->assertSession()->pageTextContains('Are you sure you want to remove the block ' . $block->label() . ' from the Left sidebar region?');
+5 −1
Original line number Diff line number Diff line
@@ -264,7 +264,11 @@ public function testViewsBlockForm() {
   */
  public function testBlockRendering() {
    // Create a block and set a custom title.
    $block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', ['label' => 'test_view_block-block_1:1', 'views_label' => 'Custom title']);
    $block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', [
      'label' => 'test_view_block-block_1:1',
      'views_label' => 'Custom title',
      'region' => 'sidebar_first',
    ]);
    $this->drupalGet('');

    $this->assertSession()->elementTextEquals('xpath', '//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2', 'Custom title');
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ protected function placeBlock($plugin_id, array $settings = []) {
    $config = \Drupal::configFactory();
    $settings += [
      'plugin' => $plugin_id,
      'region' => 'sidebar_first',
      'region' => 'content',
      'id' => strtolower($this->randomMachineName(8)),
      'theme' => $config->get('system.theme')->get('default'),
      'label' => $this->randomMachineName(8),
+9 −9
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ public function testLanguageIndependentContentModeration() {

    // Publish the Italian draft (revision 6).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 2);
    $this->clickLink('Edit', 3);
    $this->submitNodeForm('Test 1.6 IT', 'published');
    $this->assertNotLatestVersionPage($it_node);
    $this->assertNoModerationForm($node);
@@ -263,7 +263,7 @@ public function testLanguageIndependentContentModeration() {

    // Publish the French draft (revision 7).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 1);
    $this->clickLink('Edit', 2);
    $this->submitNodeForm('Test 1.7 FR', 'published');
    $this->assertNotLatestVersionPage($fr_node);
    $this->assertNoModerationForm($node);
@@ -271,7 +271,7 @@ public function testLanguageIndependentContentModeration() {

    // Create an Italian draft (revision 8).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 2);
    $this->clickLink('Edit', 3);
    $this->submitNodeForm('Test 1.8 IT', 'draft');
    $this->assertLatestVersionPage($it_node);
    $this->assertNoModerationForm($node);
@@ -279,7 +279,7 @@ public function testLanguageIndependentContentModeration() {

    // Create a French draft (revision 9).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 1);
    $this->clickLink('Edit', 2);
    $this->submitNodeForm('Test 1.9 FR', 'draft');
    $this->assertLatestVersionPage($fr_node);
    $this->assertNoModerationForm($node);
@@ -326,7 +326,7 @@ public function testLanguageIndependentContentModeration() {

    // Publish the Italian draft (revision 5).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 2);
    $this->clickLink('Edit', 3);
    $this->submitNodeForm('Test 2.5 IT', 'published');
    $this->assertNotLatestVersionPage($it_node2);
    $this->assertNoModerationForm($node2);
@@ -334,7 +334,7 @@ public function testLanguageIndependentContentModeration() {

    // Publish the French draft (revision 6).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 1);
    $this->clickLink('Edit', 2);
    $this->submitNodeForm('Test 2.6 FR', 'published');
    $this->assertNotLatestVersionPage($fr_node2);
    $this->assertNoModerationForm($node2);
@@ -358,7 +358,7 @@ public function testLanguageIndependentContentModeration() {

    // Create an Italian draft (revision 7).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 2);
    $this->clickLink('Edit', 3);
    $this->submitNodeForm('Test 2.7 IT', 'draft');
    $this->assertLatestVersionPage($it_node2);
    $this->assertNoModerationForm($node2);
@@ -366,7 +366,7 @@ public function testLanguageIndependentContentModeration() {

    // Create a French draft (revision 8).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 1);
    $this->clickLink('Edit', 2);
    $this->submitNodeForm('Test 2.8 FR', 'draft');
    $this->assertLatestVersionPage($fr_node2);
    $this->assertNoModerationForm($node2);
@@ -403,7 +403,7 @@ public function testLanguageIndependentContentModeration() {

    // Publish the French draft (revision 4).
    $this->drupalGet($translate_path);
    $this->clickLink('Edit', 1);
    $this->clickLink('Edit', 2);
    $this->submitNodeForm('Test 3.4 FR', 'published');
    $this->assertNotLatestVersionPage($fr_node3);
    $this->assertModerationForm($node3);
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public function testLanguageChange() {
    $this->clickLink('Translate');

    // Edit English translation.
    $this->clickLink('Edit');
    $this->clickLink('Edit', 1);
    // Upload and image after changing the node language.
    $images = $this->drupalGetTestFiles('image')[1];
    $edit = [
Loading