function BreakpointDiscoveryTest::testBreakpointGroups
Same name in other branches
- 9 core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php \Drupal\Tests\breakpoint\Kernel\BreakpointDiscoveryTest::testBreakpointGroups()
- 10 core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php \Drupal\Tests\breakpoint\Kernel\BreakpointDiscoveryTest::testBreakpointGroups()
- 11.x core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php \Drupal\Tests\breakpoint\Kernel\BreakpointDiscoveryTest::testBreakpointGroups()
Test the collection of breakpoint groups.
File
-
core/
modules/ breakpoint/ tests/ src/ Kernel/ BreakpointDiscoveryTest.php, line 182
Class
- BreakpointDiscoveryTest
- Tests discovery of breakpoints provided by themes and modules.
Namespace
Drupal\Tests\breakpoint\KernelCode
public function testBreakpointGroups() {
$expected = [
'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 = [
'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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.