You are here

function LegalTestCase::setSettings in Legal 6.8

Same name and namespace in other branches
  1. 7.2 legal.test \LegalTestCase::setSettings()
  2. 7 legal.test \LegalTestCase::setSettings()

Set module settings. This can only be called once from each test case instance.

5 calls to LegalTestCase::setSettings()
LegalHTMLTextDisplayTestCase::setUp in ./legal.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
LegalLinkDisplayTestCase::setUp in ./legal.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
LegalRegisterTestCase::setUp in ./legal.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
LegalScrollBoxCSSDisplayTestCase::setUp in ./legal.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
LegalScrollBoxDisplayTestCase::setUp in ./legal.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

File

./legal.test, line 22
Tests for Legal module.

Class

LegalTestCase
Legal module base test class.

Code

function setSettings($edit) {

  // Had to move to creating an user for every change in settings, since
  // creating this in setUp() was not working.
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer Terms and Conditions',
  ));
  $this
    ->drupalLogin($admin_user);
  $this
    ->drupalPost('admin/settings/legal', $edit, t('Save'));

  // Check account wasn't created.
  $this
    ->assertText(t('Terms & Conditions have been saved.'), 'T&C text setup correctly');

  // Log user out.
  $this
    ->drupalLogout();
}