You are here

public function CloudFlareAdminSettingsInvalidFormTest::testInvalidKeySpecialChars in CloudFlare 8

Test posting an invalid host to the form.

File

tests/src/Functional/CloudFlareAdminSettingsInvalidFormTest.php, line 130

Class

CloudFlareAdminSettingsInvalidFormTest
Tests \Drupal\purge_ui\Form\CloudFlareAdminSettingsForm.

Namespace

Drupal\Tests\cloudflare\Functional

Code

public function testInvalidKeySpecialChars() {
  ZoneMock::mockAssertValidCredentials(TRUE);
  ComposerDependenciesCheckMock::mockComposerDependenciesMet(FALSE);
  $edit = [
    'apikey' => '!8ow48650j63zfzx1w9jd29cr367u0ezb6a4g',
    'email' => 'test@test.com',
  ];
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalPostForm($this->route, $edit, t('Next'));
  $this
    ->assertSession()
    ->pageTextContains('Invalid Api Key: Key can only contain alphanumeric characters.');
}