You are here

public function SmsFrameworkPhoneNumberVerificationTest::testGetPhoneVerificationByPhoneNumber in SMS Framework 8

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

Tests get verification by phone number.

@covers ::getPhoneVerificationByPhoneNumber

File

tests/src/Kernel/SmsFrameworkPhoneNumberVerificationTest.php, line 170

Class

SmsFrameworkPhoneNumberVerificationTest
Tests Phone Number Provider.

Namespace

Drupal\Tests\sms\Kernel

Code

public function testGetPhoneVerificationByPhoneNumber() {
  $phone_number1 = '+123123123';
  $this
    ->createEntityWithPhoneNumber($this->phoneNumberSettings, [
    $phone_number1,
  ]);

  // Decoy:
  $phone_number2 = '+456456456';
  $this
    ->createEntityWithPhoneNumber($this->phoneNumberSettings, [
    $phone_number2,
  ]);
  $return = $this->phoneNumberVerificationProvider
    ->getPhoneVerificationByPhoneNumber($phone_number1, NULL);
  $this
    ->assertEquals(1, count($return));
}