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()

Test setting setting the US within the table.

File

src/Tests/IPBanFormTest.php, line 64

Class

IPBanFormTest
Tests the IP Ban admin page form.

Namespace

Drupal\ip_ban\Tests

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
    ->drupalPostForm(IP_BAN_ADMIN_FORM_PATH, $edit, t('Save configuration'));
  $this
    ->assertOptionSelected('edit-ip-ban-us', 2, 'Complete ban set correctly in country list table.');
}