public function BreakpointTestBase::verifyBreakpoint

Verify that a breakpoint is properly stored.

1 call to BreakpointTestBase::verifyBreakpoint()
BreakpointCRUDTest::testBreakpointCRUD in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php
Test CRUD operations for breakpoints.

File

drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php, line 31
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',
    'weight',
    'multipliers',
  );

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