public function CloudFlareAdminSettingsFormTest::testInvalidBypassHostWithHttp in CloudFlare 8
Test posting an invalid host with http protocol to the form.
File
- tests/
src/ Functional/ CloudFlareAdminSettingsFormTest.php, line 107
Class
- CloudFlareAdminSettingsFormTest
- Tests \Drupal\purge_ui\Form\CloudFlareAdminSettingsForm.
Namespace
Drupal\Tests\cloudflare\FunctionalCode
public function testInvalidBypassHostWithHttp() {
$edit = [
'apikey' => '68ow48650j63zfzx1w9jd29cr367u0ezb6a4g',
'email' => 'test@test.com',
'client_ip_restore_enabled' => TRUE,
'bypass_host' => 'http://blah.com',
];
ZoneMock::mockAssertValidCredentials(TRUE);
$this
->drupalPostForm($this->route, $edit, t('Next'));
$this
->assertSession()
->pageTextContains('Please enter a host without http/https');
}