You are here

public function IPBanFormTest::testSetCountry in IP Ban 8

Same name in this branch
  1. 8 ip_ban.test \IPBanFormTest::testSetCountry()
  2. 8 src/Tests/IPBanFormTest.php \Drupal\ip_ban\Tests\IPBanFormTest::testSetCountry()
Same name and namespace in other branches
  1. 7 ip_ban.test \IPBanFormTest::testSetCountry()

Test setting setting the US within the table.

File

./ip_ban.test, line 124
Tests for ip_ban.module.

Class

IPBanFormTest
Tests the IP Ban admin page form.

Code

public function testSetCountry() {

  // Set the United States to Complete Ban.
  $this
    ->drupalGet(IP_BAN_ADMIN_FORM_PATH);
  $edit = array();

  // 0 = no action / 1 = Read Only / 2 = Complete Ban.
  $edit['ip_ban_US'] = 2;
  $this
    ->drupalPost(IP_BAN_ADMIN_FORM_PATH, $edit, t('Save configuration'));
  $this
    ->assertOptionSelected('edit-ip-ban-us', 2, 'Complete ban set correctly in country list table.');
}