function BreakpointDiscoveryTest::testModuleBreakpoints
Tests the breakpoint group created for a module.
File
- 
              core/modules/ breakpoint/ tests/ src/ Kernel/ BreakpointDiscoveryTest.php, line 153 
Class
- BreakpointDiscoveryTest
- Tests discovery of breakpoints provided by themes and modules.
Namespace
Drupal\Tests\breakpoint\KernelCode
public function testModuleBreakpoints() {
  $expected_breakpoints = [
    'breakpoint_module_test.mobile' => [
      'label' => 'mobile',
      'mediaQuery' => '(min-width: 0px)',
      'weight' => 0,
      'multipliers' => [
        '1x',
      ],
      'provider' => 'breakpoint_module_test',
      'id' => 'breakpoint_module_test.mobile',
      'group' => 'breakpoint_module_test',
      'class' => 'Drupal\\breakpoint\\Breakpoint',
    ],
    'breakpoint_module_test.standard' => [
      'label' => 'standard',
      'mediaQuery' => '(min-width: 560px)',
      'weight' => 1,
      'multipliers' => [
        '1x',
        '2x',
      ],
      'provider' => 'breakpoint_module_test',
      'id' => 'breakpoint_module_test.standard',
      'group' => 'breakpoint_module_test',
      'class' => 'Drupal\\breakpoint\\Breakpoint',
    ],
  ];
  $breakpoints = \Drupal::service('breakpoint.manager')->getBreakpointsByGroup('breakpoint_module_test');
  $this->assertEquals(array_keys($expected_breakpoints), array_keys($breakpoints));
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
