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()
Same name and namespace in other branches
  1. 7 ip_ban.test \IPBanTestBase::addBanNode()

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

3 calls to IPBanTestBase::addBanNode()
IPBanFormTest::testBanPaths in ./ip_ban.test
Various tests for paths entered in the the admin form.
IPBanFunctionalTest::testCompleteBan in ./ip_ban.test
Test the complete ban functionality.
IPBanFunctionalTest::testReadOnlyWithDisabledBlock in ./ip_ban.test
Test the read-only and complete ban functionality.

File

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

Class

IPBanTestBase
Base class for common test configuration.

Code

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