czim / laravel-repository

Repository pattern implementation for Laravel
MIT License
51 stars 19 forks source link

(testing): Fix PHPUnit deprecations #19

Closed Tjoosten closed 3 years ago

Tjoosten commented 3 years ago

After running phpunit for this package i bumped into the following.

PHPUnit 9.5.1 by Sebastian Bergmann and contributors.

..........W....................                                   31 / 31 (100%)

Time: 00:00.861, Memory: 20.00 MB

There was 1 warning:

1) Czim\Repository\Test\BaseRepositoryTest::it_takes_criteria_and_handles_basic_criteria_manipulation
assertRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertMatchesRegularExpression() instead.
assertNotRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDoesNotMatchRegularExpression() instead.

WARNINGS!
Tests: 31, Assertions: 112, Warnings: 1.

So i replaced all the ->assertNotRegExp() methods to `->assertMatchesRegularExpression() and ->assertNotRegExp() to -> assertMatchesRegularExpression()

czim commented 3 years ago

Thanks!