You are here

public function BreakpointTestBase::verifyBreakpoint in Breakpoints 8

Verify that a breakpoint is properly stored.

1 call to BreakpointTestBase::verifyBreakpoint()
BreakpointCrudTest::testBreakpointCrud in lib/Drupal/breakpoint/Tests/BreakpointCrudTest.php
Test CRUD operations for breakpoints.

File

lib/Drupal/breakpoint/Tests/BreakpointTestBase.php, line 34
Definition of Drupal\breakpoint\Tests\BreakpointTestBase.

Class

BreakpointTestBase
Base class for Breakpoint tests.

Namespace

Drupal\breakpoint\Tests

Code

public function verifyBreakpoint(Breakpoint $breakpoint, Breakpoint $compare_breakpoint = NULL) {
  $properties = array(
    'label',
    'mediaQuery',
    'source',
    'sourceType',
    'status',
    'weight',
    'overridden',
    'multipliers',
  );
  $assert_group = t('Breakpoints API');

  // Verify breakpoint_load().
  $compare_breakpoint = is_null($compare_breakpoint) ? breakpoint_load($breakpoint
    ->getConfigName()) : $compare_breakpoint;
  foreach ($properties as $property) {
    $t_args = array(
      '%breakpoint' => $breakpoint
        ->label(),
      '%property' => $property,
    );
    $this
      ->assertEqual($compare_breakpoint->{$property}, $breakpoint->{$property}, t('breakpoint_load: Proper %property for breakpoint %breakpoint.', $t_args), $assert_group);
  }
}