Codeception / Verify

BDD Assertions for PHPUnit and Codeception
MIT License
146 stars 25 forks source link

assertContains is deprecated #38

Closed Naktibalda closed 5 years ago

Naktibalda commented 5 years ago

assertContains and assertNotContains methods call deprecated PHPUnit methods: https://github.com/Codeception/Verify/blob/1.0.0/src/Codeception/Verify.php#L54

[PHPUnit\Framework\Warning] Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.

Naktibalda commented 5 years ago

Running tests of this repository with PHPUnit 8 produces more warnings:

There were 3 warnings:

1) VerifyTest::testEquals The optional $delta parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsWithDelta() instead.

2) VerifyTest::testNotEquals The optional $delta parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsWithDelta() instead.

3) VerifyTest::testInternalType assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(), assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(), assertIsResource(), assertIsString(), assertIsScalar(), assertIsCallable(), or assertIsIterable() instead. assertNotInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsNotArray(), assertIsNotBool(), assertIsNotFloat(), assertIsNotInt(), assertIsNotNumeric(), assertIsNotObject(), assertIsNotResource(), assertIsNotString(), assertIsNotScalar(), assertIsNotCallable(), or assertIsNotIterable() instead.

https://travis-ci.org/Codeception/Verify/jobs/558318746

Naktibalda commented 5 years ago

I added new assertions in #40