public function CloudFlareAdminSettingsInvalidFormTest::testInvalidKeyLength in CloudFlare 8
Test posting an invalid host to the form.
File
- tests/
src/ Functional/ CloudFlareAdminSettingsInvalidFormTest.php, line 115
Class
- CloudFlareAdminSettingsInvalidFormTest
- Tests \Drupal\purge_ui\Form\CloudFlareAdminSettingsForm.
Namespace
Drupal\Tests\cloudflare\FunctionalCode
public function testInvalidKeyLength() {
ZoneMock::mockAssertValidCredentials(TRUE);
ComposerDependenciesCheckMock::mockComposerDependenciesMet(TRUE);
$edit = [
'apikey' => '68ow48650j63zfzx1w9jd29cr367u0ezb6a4g0',
'email' => 'test@test.com',
];
$this
->drupalLogin($this->adminUser);
$this
->drupalPostForm($this->route, $edit, t('Next'));
$this
->assertSession()
->pageTextContains('Invalid Api Key: Key should be 37 chars long.');
}