You are here

public function BreakpointDiscoveryTest::testModuleBreakpoints in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/breakpoint/src/Tests/BreakpointDiscoveryTest.php \Drupal\breakpoint\Tests\BreakpointDiscoveryTest::testModuleBreakpoints()

Test the breakpoint group created for a module.

File

core/modules/breakpoint/src/Tests/BreakpointDiscoveryTest.php, line 151
Contains \Drupal\breakpoint\Tests\BreakpointDiscoveryTest.

Class

BreakpointDiscoveryTest
Tests discovery of breakpoints provided by themes and modules.

Namespace

Drupal\breakpoint\Tests

Code

public function testModuleBreakpoints() {
  $expected_breakpoints = array(
    'breakpoint_module_test.mobile' => array(
      'label' => 'mobile',
      'mediaQuery' => '(min-width: 0px)',
      'weight' => 0,
      'multipliers' => array(
        '1x',
      ),
      'provider' => 'breakpoint_module_test',
      'id' => 'breakpoint_module_test.mobile',
      'group' => 'breakpoint_module_test',
      'class' => 'Drupal\\breakpoint\\Breakpoint',
    ),
    'breakpoint_module_test.standard' => array(
      'label' => 'standard',
      'mediaQuery' => '(min-width: 560px)',
      'weight' => 1,
      'multipliers' => array(
        '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
    ->assertEqual(array_keys($expected_breakpoints), array_keys($breakpoints));
}