Various random fails due to mis-triggered Mink deprecation error

Created on 19 March 2019, about 6 years ago
Updated 27 March 2025, about 1 month ago

Problem/Motivation

Follow #3030902: Random fail in EntityReferenceAdminTest β†’ there are more random test failure.

vendor/behat/mink/src/Selector/NamedSelector.php: triggers error 'Passing an escaped locator to the named selector is deprecated as of 1.7 and will be removed in 2.0. Pass the raw value instead.' when the following condition is TRUE.

private function escapeLocator($locator)
{
    // If the locator looks like an escaped one, don't escape it again for BC reasons.
    if (
        preg_match('/^\'[^\']*+\'$/', $locator)
        || (false !== strpos($locator, '\'') && preg_match('/^"[^"]*+"$/', $locator))
        || ((8 < $length = strlen($locator)) && 'concat(' === substr($locator, 0, 7) && ')' === $locator[$length - 1])
    ) {
        @trigger_error(
            'Passing an escaped locator to the named selector is deprecated as of 1.7 and will be removed in 2.0.'
            .' Pass the raw value instead.',
            E_USER_DEPRECATED
        );

        return $locator;
    }

    return $this->xpathEscaper->escapeLiteral($locator);
}

When we use randomString() to generate labels, it may fail tests. See #3030902: Random fail in EntityReferenceAdminTest β†’ .

Proposed resolution

Use the randomMachineName() method instead of the randomString() methods where necessary.

Remaining tasks

TBD

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component

phpunit

Created by

πŸ‡΅πŸ‡±Poland Krzysztof DomaΕ„ski Poland

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024