You are here

public function CloudFlareAdminSettingsFormTest::testMultiZoneSelection in CloudFlare 8

Test posting an invalid host to the form.

File

tests/src/Functional/CloudFlareAdminSettingsFormTest.php, line 65

Class

CloudFlareAdminSettingsFormTest
Tests \Drupal\purge_ui\Form\CloudFlareAdminSettingsForm.

Namespace

Drupal\Tests\cloudflare\Functional

Code

public function testMultiZoneSelection() {
  ZoneMock::mockAssertValidCredentials(TRUE);
  $edit = [
    'apikey' => '68ow48650j63zfzx1w9jd29cr367u0ezb6a4g',
    'email' => 'test@test.com',
  ];
  ComposerDependenciesCheckMock::mockComposerDependenciesMet(TRUE);
  ZoneMock::mockMultiZoneAccount(TRUE);
  $this
    ->drupalPostForm($this->route, $edit, t('Next'));
  $this
    ->assertSession()
    ->addressEquals('/admin/config/services/cloudflare/two?js=nojs');
  $this
    ->drupalPostForm(NULL, [
    'zone_selection' => "123456789999",
  ], t('Finish'));
  $this
    ->assertSession()
    ->responseContains('68ow48650j63zfzx1w9jd29cr367u0ezb6a4g');
  $this
    ->assertSession()
    ->responseContains('testdomain2.com');
}