function EmailValidatorTest::testIsValidException

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php \Drupal\Tests\Component\Utility\EmailValidatorTest::testIsValidException()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php \Drupal\Tests\Component\Utility\EmailValidatorTest::testIsValidException()
  3. 10 core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php \Drupal\Tests\Component\Utility\EmailValidatorTest::testIsValidException()

@covers ::isValid

File

core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php, line 36

Class

EmailValidatorTest
Tests the EmailValidator utility class.

Namespace

Drupal\Tests\Component\Utility

Code

public function testIsValidException() : void {
    $validator = new EmailValidator();
    $this->expectException(\BadMethodCallException::class);
    $this->expectExceptionMessage('Calling \\Drupal\\Component\\Utility\\EmailValidator::isValid() with the second argument is not supported. See https://www.drupal.org/node/2997196');
    $validator->isValid('example@example.com', new RFCValidation());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.