MDL-68792 theme_boost: Show the fake blocks on embedded layout.

This commit is contained in:
Mikhail Golenkov
2020-12-18 12:07:26 +11:00
parent 21c367cee6
commit 64891ca0c7
9 changed files with 152 additions and 13 deletions
+29
View File
@@ -650,4 +650,33 @@ EOF;
$this->assertTrue(in_array(['name' => 'class', 'value' => $labelclass], $data->labelattributes));
$this->assertTrue(in_array(['name' => 'style', 'value' => $labelstyle], $data->labelattributes));
}
/**
* Data provider for test_block_contents_is_fake().
*
* @return array
*/
public function block_contents_is_fake_provider() {
return [
'Null' => [null, false],
'Not set' => [false, false],
'Fake' => ['_fake', true],
'Real block' => ['activity_modules', false],
];
}
/**
* Test block_contents is_fake() method.
*
* @dataProvider block_contents_is_fake_provider
* @param mixed $value Value for the data-block attribute
* @param boolean $expected The expected result
*/
public function test_block_contents_is_fake($value, $expected) {
$bc = new block_contents(array());
if ($value !== false) {
$bc->attributes['data-block'] = $value;
}
$this->assertEquals($expected, $bc->is_fake());
}
}