Skip to content

Proposal: split assertContains for iterables and non-iterables #3422

@keradus

Description

@keradus

currently, one can do both with a single assertion:

$this->assertContains('b', ['a', 'b', 'c']);
$this->assertContains('b', 'abc');

which is confusing if someone use it like the following, and for that error prone due to accidental lack of types control

$this->assertContains('b', $haystack);

what about splitting the responsibility of that assertion, to have one for strings and one for iterables ?

ref PHP-CS-Fixer/PHP-CS-Fixer#4061

Metadata

Metadata

Labels

type/enhancementA new idea that should be implemented

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions