On clean drupal 8 installation
- go to Structure > Blocks (admin/structure/block)
- click on Seven tab (admin/structure/block/list/block_plugin_ui%253Aseven)
- click on "Demonstrate block regions (Seven)" (admin/structure/block/demo/seven)

get page with very small content
seven-block-demo.png

after clicking on 'Exit block region demonstration' (admin/structure/block/list/seven)
get a 'Page not found' error
page-not-found.png

Originally reported https://drupal.org/node/1987636#comment-7594383

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ygerasimov’s picture

Status: Active » Needs review
FileSize
2.02 KB

Attaching patch with test showing the error. It should fail.

Status: Needs review » Needs work

The last submitted patch, core-2042879-demonstrate-block-regions-test.patch, failed testing.

benjy’s picture

This bug seems to have been fixed elsewhere however we should still try get this test in.

benjy’s picture

Status: Needs work » Needs review
benjy’s picture

However, the exit link is currently broken which this test should also catch: see #2056887: Exit block region demonstration link is broken.

Status: Needs review » Needs work

The last submitted patch, core-2042879-demonstrate-block-regions-test.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

jhedstrom’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

Namespaces have changed, so at a minimum #1 needs a reroll for that.

rpayanm’s picture

I can't reproduce this bug, I follow the steps and no error.

jhedstrom’s picture

I think the remaining effort here was to get the test in, so the bug doesn't get reintroduced.

kerby70’s picture

Worked on this but wasn't seeing it come into my testing list page, is there some autoloader trick? Maybe someone can help spot the issue.
Patch attached.

kerby70’s picture

Status: Needs work » Needs review

Maybe testbot will pick it up?

kerby70’s picture

Status: Needs review » Needs work

Nope, not sure what I am missing.

tim.plunkett’s picture

  1. +++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
    @@ -0,0 +1,68 @@
    + * Tests the Demonstrate block regions functionality.
    + */
    +class BlockDemonstrateRegionsTest extends WebTestBase {
    

    This should have @group block after a blank line, see \Drupal\block\Tests\BlockTest for an example.
    This is why it's not getting picked up.

  2. +++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
    @@ -0,0 +1,68 @@
    +  /**
    +   * An administrative user to configure the test environment.
    +   */
    +  protected $adminUser;
    ...
    +    $this->adminUser = $this->drupalCreateUser(array(
    +      'administer blocks',
    +      'access administration pages',
    +    ));
    +    $this->drupalLogin($this->adminUser);
    

    You don't need a property for this, or even a variable. $this->drupalLogin($this->drupalCreateUser(....)); should be enough.

  3. +++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
    @@ -0,0 +1,68 @@
    +  public static function getInfo() {
    +    return array(
    +      'name' => 'Block Demonstrate block regions',
    +      'description' => 'Tests functionality of "Demonstrate block regions".',
    +      'group' => 'Block',
    +    );
    +  }
    

    This can be removed.

  4. +++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
    @@ -0,0 +1,68 @@
    +
    +  function setUp() {
    +    parent::setUp();
    

    This should have {@inheritdoc} as a docblock

  5. +++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
    @@ -0,0 +1,68 @@
    +  function setUp() {
    ...
    +  function testDemonstrateSeven() {
    

    protected function setUp
    public function testDemonstrateSeven

  6. +++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
    @@ -0,0 +1,68 @@
    +   * Test Demonstrate block admin page exists and functions correctly.
    

    Tests 'Demonstrate block regions' page exists and functions correctly.

Finally, since this is a new file it'd be nice to use [] instead of array() in all occurrences.

kerby70’s picture

Thanks @tim.plunkett.

Reroll based on #15.

Looks like \Drupal::service('theme_handler')->enable() changed to \Drupal::service('theme_handler')->install().

This might be a bug in \Drupal\simpletest\WebTestBase::clickLink()

I'm getting an odd error "Link Demonstrate block regions (Seven) does not exist on http://drupal8_2.dev/admin/structure/block/list/seven" while testing. Even though the link is definitely there and the text matches exactly.

kerby70’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 16: theme_seven_has-2042879-16.patch, failed testing.

siva_epari’s picture

Help module needs to be enabled & the help block's system name is help_block.

Also, as suggested in #15 removed:

+++ b/core/modules/block/src/Tests/BlockDemonstrateRegionsTest.php
@@ -0,0 +1,68 @@
+  public static function getInfo() {
+    return array(
+      'name' => 'Block Demonstrate block regions',
+      'description' => 'Tests functionality of "Demonstrate block regions".',
+      'group' => 'Block',
+    );
+  }
siva_epari’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
Truptti’s picture

Followed the steps to reproduce the issue, but the error is not displayed.The issue is not reproducible

rpayanm’s picture

I agree @Truptti. I can't reproduce this issue.

I vote for "Close (cannot reproduce)".

joelpittet’s picture

Status: Needs review » Closed (cannot reproduce)

As per #21 and #22