Problem/Motivation

If you use run-tests without the --sqlite param on Drupal 9 (this param is basically mandatory now that Simpletest is no longer in core) you get a deprecation warning.

Steps to reproduce

Run something like sudo -u _www php ./core/scripts/run-tests.sh --color --non-html --url http://drupal8alt.test/ --class '\\Drupal\\KernelTests\\Core\\KeyValueStore\\DatabaseStorageTest'

The particular test class does not matter.

Proposed resolution

Fix the deprecation.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3244592-2.patch826 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new826 bytes

Current output of running sudo -u _www php ./core/scripts/run-tests.sh --color --non-html --url http://drupal8alt.test/ --class '\\Drupal\\KernelTests\\Core\\KeyValueStore\\DatabaseStorageTest' on HEAD:

PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /Users/alex/dev/sites/drupal8alt.dev/core/scripts/run-tests.sh on line 483

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /Users/alex/dev/sites/drupal8alt.dev/core/scripts/run-tests.sh on line 483
  ERROR: Missing Simpletest database schema. Either install Simpletest module or use the --sqlite parameter.

Whereas we should just have:

  ERROR: Missing Simpletest database schema. Either install Simpletest module or use the --sqlite parameter.
daffie’s picture

Status: Needs review » Reviewed & tested by the community

The second parameter of preg_match() must be a string.
Looks good to me.

andypost’s picture

  • catch committed a1fc82b on 9.3.x
    Issue #3244592 by alexpott: Fix deprecation error in run-tests.sh on PHP...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.3.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.