Skip to content

Make possible to use assertMatchesPattern in static methods #352

@alexander-schranz

Description

@alexander-schranz

Sometimes I get into cases where I want to use the assertMatchesPattern like other assertions in a static method.

Maybe the assertMatchesPattern could be changed from:

    protected function assertMatchesPattern($pattern, $value, string $message = '') : void
    {
        TestCase::assertThat($value, self::matchesPattern($pattern, $this->backtrace), $message);
    }
    protected function static assertMatchesPattern($pattern, $value, string $message = '', ?Backtrace $backtrace = null) : void
    {
        TestCase::assertThat($value, self::matchesPattern($pattern, ?Backtrace $backtrace = null), $message);
    }

As it would be a bc break it could only be done in a new major release.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions