public function IPBanTestBase::setUp in IP Ban 7
Same name and namespace in other branches
- 8 ip_ban.test \IPBanTestBase::setUp()
Implement setUp().
Overrides DrupalWebTestCase::setUp
2 calls to IPBanTestBase::setUp()
- IPBanFormTest::setUp in ./
ip_ban.test - Implement setUp().
- IPBanFunctionalTest::setUp in ./
ip_ban.test - Implement setUp().
2 methods override IPBanTestBase::setUp()
- IPBanFormTest::setUp in ./
ip_ban.test - Implement setUp().
- IPBanFunctionalTest::setUp in ./
ip_ban.test - Implement setUp().
File
- ./
ip_ban.test, line 22 - Tests for ip_ban.module.
Class
- IPBanTestBase
- Base class for common test configuration.
Code
public function setUp() {
// ip2country is required by ip_ban, and therefore needed for some of the
// unit and functional testing.
parent::setUp(array(
'ip_ban',
'ip2country',
));
// Add a content type to create dummy page for testing valid paths and
// proper redirects.
$this->ipBanType = $this
->drupalCreateContentType(array(
'name' => 'IP Ban Node',
'type' => 'ipban_node',
));
// Create and log in our privileged user.
$this->adminSitesUser = $this
->drupalCreateUser(array(
'administer site configuration',
'create ipban_node content',
'edit any ipban_node content',
'access content',
'bypass node access',
'administer blocks',
// The admin must have this permission to avoid immediately losing access
// when using a spoofed IP address.
'ignore ip_ban',
));
}