protected function SmsFrameworkPhoneNumberProviderTest::setUp in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Kernel/SmsFrameworkPhoneNumberProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkPhoneNumberProviderTest::setUp()
- 2.1.x tests/src/Kernel/SmsFrameworkPhoneNumberProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkPhoneNumberProviderTest::setUp()
Overrides SmsFrameworkKernelBase::setUp
File
- tests/
src/ Kernel/ SmsFrameworkPhoneNumberProviderTest.php, line 67
Class
- SmsFrameworkPhoneNumberProviderTest
- Tests Phone Number Provider.
Namespace
Drupal\Tests\sms\KernelCode
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('entity_test');
$this
->installEntitySchema('sms_phone_number_verification');
$this->gateway = $this
->createMemoryGateway([
'skip_queue' => TRUE,
]);
$this
->setFallbackGateway($this->gateway);
$this->phoneNumberProvider = $this->container
->get('sms.phone_number');
$this->phoneField = FieldStorageConfig::create([
'entity_type' => 'entity_test',
'field_name' => Unicode::strtolower($this
->randomMachineName()),
'type' => 'telephone',
]);
$this->phoneField
->save();
FieldConfig::create([
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
'field_name' => $this->phoneField
->getName(),
])
->save();
$this->phoneNumberSettings = PhoneNumberSettings::create();
$this->phoneNumberSettings
->setPhoneNumberEntityTypeId('entity_test')
->setPhoneNumberBundle('entity_test')
->setFieldName('phone_number', $this->phoneField
->getName())
->setVerificationMessage($this
->randomString())
->save();
}