Closed (fixed)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
Block Example
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jun 2015 at 15:16 UTC
Updated:
20 Sep 2015 at 21:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anavarreI'm not sure I understand the point of the test in BlockExampleTest.php::testBlockExampleBasic(). We have a comment saying "Verify that blocks are there. Empty block will not be shown, because it is empty." but the goal is to display an empty block, not to demonstrate that an empty array prevents the block from showing up, right?
With the above patch, the below assertion will thus fail and we'd need to use assertRaw() instead.
$this->assertNoRaw($settings_empty['label'], 'Block empty not found.');If we really, truly think that behavior is correct, then it'd require more documentation in ExampleEmptyBlock::build() because it's confusing for sure.
Attached patch fixes the test accordingly to what's the assumed normal behavior.
Comment #3
marvil07 commentedI guess the confusion comes from the interpretation of what an empty block means. In the current code the idea seems to be referring to an empty block array instead of an empty block content. I would say it is OK to extend documentation to mention the difference.
Comment #4
anavarreI still don't really understand why we'd prefer an empty array to an empty block content (especially since it was an empty block content before) but here's another approach with better documentation to hopefully clarify the intent.
Comment #6
anavarreComment #7
mile23Nice documentation patch, thanks.