Convert IpAddressBlockingTest to a Unit and Kernel test and improve

Created on 15 August 2024, 4 months ago
Updated 3 September 2024, 3 months ago

Problem/Motivation

\Drupal\Tests\ban\Functional\IpAddressBlockingTest inefficiently logs in a user and submits a form several times to test validation that could be done in a unit test. There is some database interaction, so we can split that part to a kernel test.

Before: ~16 seconds
After: ~1 second

Steps to reproduce

Proposed resolution

  • Test BanIpManagerInterface::banIp in a kernel test (BanIpTest::testBanIp)
  • Test IP validation in a unit test (BanAdminTest::testIpValidation)
  • Test form submission calls BanIpManagerInterface::banIp in a unit test (BanAdminTest::testFormSubmission)
  • Test form build adds default ip from route param in a unit test (BanAdminTest::testRouteParameter)

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
BanΒ  β†’

Last updated 12 days ago

No maintainer
Created by

πŸ‡¦πŸ‡ΊAustralia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024