From 14ce42c8843c605ed2ae4e7863aa2a6fb14095cf Mon Sep 17 00:00:00 2001 From: Serhii Petrov Date: Sat, 7 Oct 2023 16:35:40 +0300 Subject: [PATCH] Test against php 8.1, 8.2 and 8.3 * drop tests for php < 7.3 * migrate phpunit.xml schema * fix tests in order to work on phpunit 10 --- .github/workflows/test.yml | 12 ++++-------- .gitignore | 3 ++- phpunit.xml | 11 +---------- tests/Valitron/StopOnFirstFailTest.php | 2 +- tests/Valitron/ValidateAddInstanceRuleTest.php | 2 +- tests/Valitron/ValidateTest.php | 2 +- 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93e07ad..8f5267f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,16 +9,12 @@ jobs: matrix: operating-system: ['ubuntu-latest'] php-versions: - - '5.4' - - '5.5' - - '5.6' - - '7.0' - - '7.1' - - '7.2' - '7.3' - '7.4' - '8.0' - # - '8.1' + - '8.1' + - '8.2' + - '8.3' steps: - name: Checkout uses: actions/checkout@v2 @@ -70,4 +66,4 @@ jobs: # composer install --no-progress # - name: Run tests # run: | -# composer run-script test \ No newline at end of file +# composer run-script test diff --git a/.gitignore b/.gitignore index 12d6107..1d352f5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ composer.phar composer.lock vendor .idea/ -.phpunit.result.cache \ No newline at end of file +.phpunit.result.cache +/.phpunit.cache diff --git a/phpunit.xml b/phpunit.xml index 9a3a822..312218f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,14 +1,5 @@ - + tests/Valitron diff --git a/tests/Valitron/StopOnFirstFailTest.php b/tests/Valitron/StopOnFirstFailTest.php index 1e624f6..32af81c 100644 --- a/tests/Valitron/StopOnFirstFailTest.php +++ b/tests/Valitron/StopOnFirstFailTest.php @@ -2,7 +2,7 @@ use Valitron\Validator; -class StopOnFirstFail extends BaseTestCase +class StopOnFirstFailTest extends BaseTestCase { public function testStopOnFirstFail() { diff --git a/tests/Valitron/ValidateAddInstanceRuleTest.php b/tests/Valitron/ValidateAddInstanceRuleTest.php index 03cf5cb..6bf7a01 100644 --- a/tests/Valitron/ValidateAddInstanceRuleTest.php +++ b/tests/Valitron/ValidateAddInstanceRuleTest.php @@ -115,6 +115,6 @@ public function testUniqueRuleName() $v->addInstanceRule("foo_rule", function () { }); $u = $v->getUniqueRuleName("foo"); - $this->assertRegExp("/^foo_rule_[0-9]{1,5}$/", $u); + $this->assertMatchesRegularExpression("/^foo_rule_[0-9]{1,5}$/", $u); } } diff --git a/tests/Valitron/ValidateTest.php b/tests/Valitron/ValidateTest.php index a7f7158..9625b20 100644 --- a/tests/Valitron/ValidateTest.php +++ b/tests/Valitron/ValidateTest.php @@ -2602,7 +2602,7 @@ public function testError($expected, $input, $test, $message) $this->assertEquals(array('test' => array($expected)), $v->errors()); } - public function dataProviderFor_testError() + public static function dataProviderFor_testError() { return array( array(