Skip to content

Clean up assertContains() and assertNotContains() #3426

@sebastianbergmann

Description

@sebastianbergmann
  • Remove support for using assertContains() and assertNotContains() on string haystacks
  • Remove the optional parameters $ignoreCase, $checkForObjectIdentity, and $checkForNonObjectIdentity of assertContains() and assertNotContains()
  • Remove Assert::contains()
  • Eliminate code duplication in TraversableContainsEqual and TraversableContainsIdentical by inheriting from TraversableContains (which becomes an abstract base class for these two concrete classes)
  • Use TraversableContainsIdentical in Assert::assertContains() and Assert::assertNotContains() (this means that assertContains() and assertNotContains() will perform strict comparisons starting with PHPUnit 9 where non-strict comparisons were performed in PHPUnit 8 and earlier; use assertContainsEqual() and assertNotContainsEqual() if you need non-strict comparison)

Metadata

Metadata

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions