Skip to content

Commit

Permalink
Test against php 8.1, 8.2 and 8.3
Browse files Browse the repository at this point in the history
* drop tests for php < 7.3
* migrate phpunit.xml schema
* fix tests in order to work on phpunit 10
  • Loading branch information
sergiy-petrov committed Oct 7, 2023
1 parent fadce39 commit 14ce42c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 22 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -70,4 +66,4 @@ jobs:
# composer install --no-progress
# - name: Run tests
# run: |
# composer run-script test
# composer run-script test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ composer.phar
composer.lock
vendor
.idea/
.phpunit.result.cache
.phpunit.result.cache
/.phpunit.cache
11 changes: 1 addition & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Valitron Test Suite">
<directory suffix="Test.php">tests/Valitron</directory>
Expand Down
2 changes: 1 addition & 1 deletion tests/Valitron/StopOnFirstFailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Valitron\Validator;

class StopOnFirstFail extends BaseTestCase
class StopOnFirstFailTest extends BaseTestCase
{
public function testStopOnFirstFail()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Valitron/ValidateAddInstanceRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion tests/Valitron/ValidateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 14ce42c

Please sign in to comment.