MailchimpAdminSettingsFormTest.php in Mailchimp 8
File
tests/src/Functional/MailchimpAdminSettingsFormTest.php
View source
<?php
namespace Drupal\Tests\mailchimp\Functional;
class MailchimpAdminSettingsFormTest extends FunctionalMailchimpTestBase {
protected static $override = FALSE;
public function testSettingsForm() {
$this
->drupalLogin($this->lowUser);
$this
->drupalGet('/admin/config/services/mailchimp');
$this
->assertResponse(403);
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('/admin/config/services/mailchimp');
$this
->assertResponse(200);
$this
->submitForm([
'api_key' => 'TEST_KEY',
], 'Save configuration');
$this
->assertText('The configuration options have been saved');
$this
->assertEquals('TEST_KEY', \Drupal::config('mailchimp.settings')
->get('api_key'));
}
}