You are here

function BreakpointGroupTestCase::verifyBreakpointGroup in Breakpoints 7

Verify that a breakpoint is properly stored.

3 calls to BreakpointGroupTestCase::verifyBreakpointGroup()
BreakpointGroupAdminTestCase::testBreakpointGroupExportImport in ./breakpoints.test
Test breakpoint group export/import functionality.
BreakpointGroupCRUDTestCase::testBreakpointGroupCRUD in ./breakpoints.test
Test CRUD operations for breakpoint groups.
BreakpointsThemeTestCase::testThemeBreakpoints in ./breakpoints.test
Test the breakpoints provided by a theme.

File

./breakpoints.test, line 290
Tests for breakpoints.module

Class

BreakpointGroupTestCase
Base class for Breakpoint Group tests.

Code

function verifyBreakpointGroup($group, $in_database = TRUE) {
  $t_args = array(
    '%group' => $group->name,
  );
  $properties = array(
    'name',
    'machine_name',
    'breakpoints',
  );
  if ($in_database) {
    $properties[] = 'id';
  }
  $assert_group = t('Breakpoints API');

  // Verify text format database record.
  $db_group = db_select('breakpoint_group', 'bg')
    ->fields('bg')
    ->condition('machine_name', $group->machine_name)
    ->execute()
    ->fetchObject();
  $db_group->breakpoints = unserialize($db_group->breakpoints);
  foreach ($properties as $property) {
    $this
      ->assertEqual($db_group->{$property}, $group->{$property}, t('Database: Proper ' . $property . ' for breakpoint group %group.', $t_args), $assert_group);
  }

  // Verify breakpoints_breakpoint_group_load().
  $load_group = breakpoints_breakpoint_group_load($group->machine_name);
  foreach ($properties as $property) {
    $this
      ->assertEqual($load_group->{$property}, $group->{$property}, t('breakpoints_breakpoint_group_load: Proper ' . $property . ' for breakpoint group %group.', $t_args), $assert_group);
  }
}