Skip to content
Snippets Groups Projects

Issue #3468435: Convert IpAddressBlockingTest to a Unit and Kernel test

Closed Issue #3468435: Convert IpAddressBlockingTest to a Unit and Kernel test
1 unresolved thread
Closed Michael Strelan requested to merge issue/drupal-3468435:3468435-ban-admin-test into 11.x
1 unresolved thread

Closes #3468435

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
77 // Pass an IP address as a URL parameter and submit it.
78 $submit_ip = '1.2.3.4';
79 $this->drupalGet('admin/config/people/ban/' . $submit_ip);
80 $this->submitForm([], 'Add');
81 $ip = $connection->select('ban_ip', 'bi')->fields('bi', ['iid'])->condition('ip', $submit_ip)->execute()->fetchField();
82 $this->assertNotEmpty($ip, 'IP address found in database');
83 $this->assertSession()->pageTextContains("The IP address $submit_ip has been banned.");
84
85 // Submit your own IP address. This fails, although it works when testing
86 // manually.
87 // @todo On some systems this test fails due to a bug/inconsistency in cURL.
88 // $edit = array();
89 // $edit['ip'] = \Drupal::request()->getClientIP();
90 // $this->drupalGet('admin/config/people/ban');
91 // $this->submitForm($edit, 'Save');
92 // $this->assertSession()->pageTextContains('You may not ban your own IP address.');
  • Michael Strelan added 2 commits

    added 2 commits

    Compare with previous version

  • Michael Strelan added 2 commits

    added 2 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Michael Strelan added 8 commits

    added 8 commits

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading