Skip to content

assertContains always claiming it'll return true #193

Closed
@simon-tma

Description

@simon-tma

Reproduction case:

        $this->assertContains('not in the list', new \ArrayObject([1]));

This generates the error:

Call to method PHPUnit\Framework\Assert::assertContains() with 'not in the list' and ArrayObject<int, int> will always evaluate to true.

This is obviously incorrect and appears to happen whenever $haystack is a \Traversable rather than an array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions