public function BreakpointGroupTestBase::verifyBreakpointGroup

Verify that a breakpoint is properly stored.

4 calls to BreakpointGroupTestBase::verifyBreakpointGroup()
BreakpointGroupCRUDTest::testBreakpointGroupCRUD in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupCRUDTest.php
Test CRUD operations for breakpoint groups.
BreakpointThemeTest::testThemeBreakpointGroup in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointThemeTest.php
Test the breakpoints defined by the custom group.
BreakpointThemeTest::testThemeBreakpointGroupModule in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointThemeTest.php
Test the breakpoints defined by the custom group in the module.
BreakpointThemeTest::testThemeBreakpoints in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointThemeTest.php
Test the breakpoints provided by a theme.

File

drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupTestBase.php, line 31
Definition of Drupal\breakpoint\Tests\BreakpointGroupTestBase.

Class

BreakpointGroupTestBase
Base class for Breakpoint group tests.

Namespace

Drupal\breakpoint\Tests

Code

public function verifyBreakpointGroup(BreakpointGroup $group, BreakpointGroup $compare_set = NULL) {
  $properties = array(
    'label',
    'id',
    'name',
    'breakpoints',
    'sourceType',
  );

  // Verify breakpoint_group_load().
  $compare_set = is_null($compare_set) ? entity_load('breakpoint_group', $group
    ->id()) : $compare_set;
  foreach ($properties as $property) {
    $t_args = array(
      '%group' => $group
        ->label(),
      '%property' => $property,
    );
    if (is_array($compare_set->{$property})) {
      $this
        ->assertEqual(array_keys($compare_set->{$property}), array_keys($group->{$property}), format_string('breakpoint_group_load: Proper %property for breakpoint group %group.', $t_args), 'Breakpoint API');
    }
    else {
      $t_args = array(
        '%group' => $group
          ->label(),
        '%property' => $property,
        '%property1' => $compare_set->{$property},
        '%property2' => $group->{$property},
      );
      $this
        ->assertEqual($compare_set->{$property}, $group->{$property}, format_string('breakpoint_group_load: Proper %property: %property1 == %property2 for breakpoint group %group.', $t_args), 'Breakpoint API');
    }
  }
}