You are here

public function AvailabilityCalendarMigrateUnitTest::testAvailabilityCalendarImport in Availability Calendars 7.5

Verify that availability data is correctly imported.

File

tests/availability_calendar_migrate.test, line 32
Test integration with Migrate.

Class

AvailabilityCalendarMigrateUnitTest
Test migration of availability data.

Code

public function testAvailabilityCalendarImport() {
  $migration = Migration::getInstance('ExampleAvailabilityCalendar');
  $result = $migration
    ->processImport();
  $this
    ->assertEqual($result, Migration::RESULT_COMPLETED, t('Import returned RESULT_COMPLETED'));
  $calendar_entities_number = 0;
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'availability_calendar_calendar');
  $result = $query
    ->execute();
  if (!empty($result['availability_calendar_calendar'])) {
    $calendar_entities_number = count($result['availability_calendar_calendar']);
  }
  $this
    ->assertEqual($calendar_entities_number, 2, t('Two Availability Calendar entities created'));
}