You are here

public function SmsFrameworkPhoneNumberTest::testPhoneNumberVerificationDeleted in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/SmsFrameworkPhoneNumberTest.php \Drupal\Tests\sms\Functional\SmsFrameworkPhoneNumberTest::testPhoneNumberVerificationDeleted()
  2. 2.1.x tests/src/Functional/SmsFrameworkPhoneNumberTest.php \Drupal\Tests\sms\Functional\SmsFrameworkPhoneNumberTest::testPhoneNumberVerificationDeleted()

Ensure phone number verification are deleted.

See also

sms_entity_delete()

File

tests/src/Functional/SmsFrameworkPhoneNumberTest.php, line 83

Class

SmsFrameworkPhoneNumberTest
General phone number verification tests.

Namespace

Drupal\Tests\sms\Functional

Code

public function testPhoneNumberVerificationDeleted() {
  $phone_number_settings = $this
    ->createPhoneNumberSettings('entity_test', 'entity_test');
  $entities = [];
  for ($i = 0; $i < 3; $i++) {
    $phone_numbers = [
      '+123123123',
      '+456456456',
    ];
    $entities[] = $this
      ->createEntityWithPhoneNumber($phone_number_settings, $phone_numbers);
  }
  $this
    ->assertEqual(6, $this
    ->countVerificationCodes());
  $entities[1]
    ->delete();
  $this
    ->assertEqual(4, $this
    ->countVerificationCodes(), 'Verification codes deleted.');
}