Optimize TelephoneFieldTest

Created on 19 July 2024, about 2 months ago
Updated 12 August 2024, 27 days ago

Problem/Motivation

This test uses a provider which is inherently slow for functional tests because each invocation installs Drupal. We can just use a foreach.

Numbers from my local machine/ddev:

Before:

../vendor/bin/phpunit modules/telephone/tests/src/Functional/TelephoneFieldTest.php
PHPUnit 10.5.26 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.8
Configuration: /var/www/html/core/phpunit.xml

............                                                      12 / 12 (100%)

Time: 01:46.429, Memory: 4.00 MB

OK (12 tests, 121 assertions)

After:

../vendor/bin/phpunit modules/telephone/tests/src/Functional/TelephoneFieldTest.php
PHPUnit 10.5.26 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.8
Configuration: /var/www/html/core/phpunit.xml

..                                                                  2 / 2 (100%)

Time: 00:19.843, Memory: 4.00 MB

OK (2 tests, 41 assertions)

1m46s down to 19s

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3

Component
PHPUnit 

Last updated about 11 hours ago

Created by

🇬🇧United Kingdom catch

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