You are here

public function MigrateD7SmsPhoneNumberTest::testMigrationRequirements in SMS Framework 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/Migrate/MigrateD7SmsPhoneNumberTest.php \Drupal\Tests\sms\Kernel\Migrate\MigrateD7SmsPhoneNumberTest::testMigrationRequirements()
  2. 2.1.x tests/src/Kernel/Migrate/MigrateD7SmsPhoneNumberTest.php \Drupal\Tests\sms\Kernel\Migrate\MigrateD7SmsPhoneNumberTest::testMigrationRequirements()

Tests that the requirements for the d7_sms_number migration are enforced.

File

tests/src/Kernel/Migrate/MigrateD7SmsPhoneNumberTest.php, line 42

Class

MigrateD7SmsPhoneNumberTest
Tests Drupal 7 SMS User phone number migrations.

Namespace

Drupal\Tests\sms\Kernel\Migrate

Code

public function testMigrationRequirements() {

  // @todo Work out a better fix https://www.drupal.org/project/smsframework/issues/2951758
  if (method_exists($this, 'expectException')) {
    $this
      ->expectException(RequirementsException::class);
    $this
      ->expectExceptionMessageRegExp('/Missing migrations (d7_user|phone_number_settings), (d7_user|phone_number_settings)/');
  }
  else {
    $this
      ->setExpectedExceptionRegExp(RequirementsException::class, '/Missing migrations (d7_user|phone_number_settings), (d7_user|phone_number_settings)/');
  }
  $this
    ->getMigration('d7_sms_number')
    ->checkRequirements();
}