public function BreakpointDiscoveryTest::testBreakpointGroups in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/breakpoint/src/Tests/BreakpointDiscoveryTest.php \Drupal\breakpoint\Tests\BreakpointDiscoveryTest::testBreakpointGroups()
Test the collection of breakpoint groups.
File
- core/
modules/ breakpoint/ src/ Tests/ BreakpointDiscoveryTest.php, line 187 - Contains \Drupal\breakpoint\Tests\BreakpointDiscoveryTest.
Class
- BreakpointDiscoveryTest
- Tests discovery of breakpoints provided by themes and modules.
Namespace
Drupal\breakpoint\TestsCode
public function testBreakpointGroups() {
$expected = array(
'bartik' => 'Bartik',
'breakpoint_module_test' => 'Breakpoint test module',
'breakpoint_theme_test' => 'Breakpoint test theme',
'breakpoint_theme_test.group2' => 'breakpoint_theme_test.group2',
);
$breakpoint_groups = \Drupal::service('breakpoint.manager')
->getGroups();
// Ensure the order is as expected. Should be sorted by label.
$this
->assertIdentical($expected, $this
->castSafeStrings($breakpoint_groups));
$expected = array(
'breakpoint_theme_test' => 'theme',
'breakpoint_module_test' => 'module',
);
$breakpoint_group_providers = \Drupal::service('breakpoint.manager')
->getGroupProviders('breakpoint_theme_test.group2');
$this
->assertEqual($expected, $breakpoint_group_providers);
}