function BotchaTestCase::setUp in BOTCHA Spam Prevention 6.2
Same name and namespace in other branches
- 6.3 tests/botcha.simpletest.test \BotchaTestCase::setUp()
- 7.2 botcha.test \BotchaTestCase::setUp()
- 7.3 tests/botcha.simpletest.test \BotchaTestCase::setUp()
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. A temporary files directory is created with the same name as the database prefix.
Parameters
...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.
Overrides BotchaBaseWebTestCase::setUp
5 calls to BotchaTestCase::setUp()
- BotchaHoneypot2TestCase::setUp in ./
botcha.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.…
- BotchaHoneypotTestCase::setUp in ./
botcha.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.…
- BotchaNoResubmitTestCase::setUp in ./
botcha.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.…
- BotchaObscureUrlTestCase::setUp in ./
botcha.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.…
- BotchaTimegateTestCase::setUp in ./
botcha.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.…
5 methods override BotchaTestCase::setUp()
- BotchaHoneypot2TestCase::setUp in ./
botcha.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.…
- BotchaHoneypotTestCase::setUp in ./
botcha.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.…
- BotchaNoResubmitTestCase::setUp in ./
botcha.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.…
- BotchaObscureUrlTestCase::setUp in ./
botcha.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.…
- BotchaTimegateTestCase::setUp in ./
botcha.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
- ./
botcha.test, line 898 - Tests for BOTCHA module.
Class
- BotchaTestCase
- Testing general BOTCHA functionality.
Code
function setUp() {
parent::setUp();
// Allow comment posting for guests.
$this
->allowCommentPostingForAnonymousVisitors();
// For some reason we don't find this form after installation - but we should.
// So fix it manually.
Botcha::getForm('comment_form', TRUE)
->setEnabled(TRUE)
->save();
// Create recipebook "test" + bind all forms to it.
$recipebook = Botcha::getRecipebook('test', TRUE)
->setTitle('Test recipebook')
->setDescription("Created for {$this->testId}");
foreach (Botcha::getForms() as $form) {
$recipebook = $recipebook
->setForm($form->id);
}
$recipebook
->save();
}