You are here

public function IPBanTestBase::addBanNode in IP Ban 8

Same name in this branch
  1. 8 ip_ban.test \IPBanTestBase::addBanNode()
  2. 8 src/Tests/IPBanTestBase.php \Drupal\ip_ban\Tests\IPBanTestBase::addBanNode()

Add a node of type ipban-node for path and other testing.

4 calls to IPBanTestBase::addBanNode()
IPBanFormTest::testBanPaths in src/Tests/IPBanFormTest.php
Various tests for paths entered in the the admin form.
IPBanFormTest::testIpAddressEntry in src/Tests/IPBanFormTest.php
Test adding IP address in various fields (correct and incorrect).
IPBanFunctionalTest::testCompleteBan in src/Tests/IPBanFunctionalTest.php
Test the complete ban functionality.
IPBanFunctionalTest::testReadOnlyWithDisabledBlock in src/Tests/IPBanFunctionalTest.php
Test the read-only and complete ban functionality.

File

src/Tests/IPBanTestBase.php, line 71

Class

IPBanTestBase
IP Ban Admin form tests.

Namespace

Drupal\ip_ban\Tests

Code

public function addBanNode($title = '') {
  if (empty($title)) {
    $title = $this
      ->randomMachineName();
  }
  $edit = array();
  $edit['title[0][value]'] = $title;
  $this
    ->drupalGet('node/add/ipban_node');
  $this
    ->drupalPostForm('node/add/ipban_node', $edit, t('Save'));
  $this
    ->assertText('IP Ban Node ' . $edit['title[0][value]'] . ' has been created', 'Found node creation message');
}