MigrateD7SmsPhoneNumberTest.php in SMS Framework 8
File
tests/src/Kernel/Migrate/MigrateD7SmsPhoneNumberTest.php
View source
<?php
namespace Drupal\Tests\sms\Kernel\Migrate;
use Drupal\migrate\Exception\RequirementsException;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
class MigrateD7SmsPhoneNumberTest extends MigrateDrupal7TestBase {
use MigratePhoneNumberTestTrait;
protected function setUp() {
parent::setUp();
$this
->loadFixture(__DIR__ . '/../../../fixtures/migrate/drupal7.php');
}
public static $modules = [
'sms',
'telephone',
'dynamic_entity_reference',
'filter',
];
public function testMigrationRequirements() {
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();
}
protected function getMigrationsToTest() {
return [
'd7_filter_format',
'd7_user_role',
'd7_user',
'phone_number_settings',
'd7_sms_number',
];
}
protected function getMigrationsToRollback() {
return [
'd7_sms_number',
'phone_number_settings',
];
}
protected function smsUserFixtureFilePath() {
return __DIR__ . '/../../../fixtures/migrate/sms_user_drupal7.php';
}
protected function confirmationMessageFixturePath() {
return __DIR__ . '/../../../fixtures/migrate/sms_confirmation_message_d7.php';
}
}