diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 7649e16e0..d09945a7d 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -46,10 +46,10 @@ jobs:
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}
- name: Run Unit Tests
- run: ./vendor/phpunit/phpunit/phpunit --testsuite=unit
+ run: ./vendor/bin/phpunit --testsuite=unit
- name: Run Integration Tests
- run: ./vendor/phpunit/phpunit/phpunit --testsuite=integration
+ run: ./vendor/bin/pest --testsuite=feature --compact
code-coverage:
name: Code coverage
@@ -78,7 +78,7 @@ jobs:
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}
- name: Generating Code Coverage Report
- run: ./vendor/phpunit/phpunit/phpunit --coverage-clover=coverage.xml
+ run: ./vendor/bin/pest --compact --coverage-clover=coverage.xml
- name: Send Code Coverage Report to Codecov.io
uses: codecov/codecov-action@v5
diff --git a/composer.json b/composer.json
index 0fae6ab99..5a7f30faa 100644
--- a/composer.json
+++ b/composer.json
@@ -15,6 +15,7 @@
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
+ "pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
},
@@ -29,6 +30,7 @@
"malukenho/docheader": "^1.0",
"mikey179/vfsstream": "^1.6",
"nette/php-generator": "^4.1",
+ "pestphp/pest": "^2.36",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
@@ -60,23 +62,20 @@
"Respect\\Validation\\": "tests/unit/",
"Respect\\Validation\\Test\\": "tests/library/"
},
- "files": [
- "tests/integration/lib/aliases.php",
- "tests/integration/lib/helpers.php"
- ]
+ "files": ["tests/aliases.php"]
},
"scripts": {
"docheader": "vendor/bin/docheader check library/ tests/",
"phpcs": "vendor/bin/phpcs",
"phpstan": "vendor/bin/phpstan analyze",
- "phpunit": "vendor/bin/phpunit",
- "phpunit-integration": "vendor/bin/phpunit --testsuite=integration",
- "phpunit-unit": "vendor/bin/phpunit --testsuite=unit",
+ "phpunit": "vendor/bin/phpunit --testsuite=unit",
+ "pest": "vendor/bin/pest --testsuite=feature --compact",
"qa": [
"@docheader",
"@phpcs",
"@phpstan",
- "@phpunit"
+ "@phpunit",
+ "@pest"
]
}
}
diff --git a/library/Transformers/DeprecatedAttribute.php b/library/Transformers/DeprecatedAttribute.php
index aef8e819a..050880a6e 100644
--- a/library/Transformers/DeprecatedAttribute.php
+++ b/library/Transformers/DeprecatedAttribute.php
@@ -48,7 +48,7 @@ public function transform(RuleSpec $ruleSpec): RuleSpec
if ($name === 'property') {
trigger_error(
- $firstMessage . ' Use property() without it.',
+ $firstMessage . ' Use property() instead.',
E_USER_DEPRECATED
);
}
diff --git a/library/Transformers/DeprecatedKey.php b/library/Transformers/DeprecatedKey.php
index 224178da9..e2c55e058 100644
--- a/library/Transformers/DeprecatedKey.php
+++ b/library/Transformers/DeprecatedKey.php
@@ -52,7 +52,7 @@ public function transform(RuleSpec $ruleSpec): RuleSpec
if ($name === 'key') {
trigger_error(
'Calling key() with a third parameter has been deprecated, ' .
- 'and will be not be allowed in the next major version. Use key() without it the third parameter.',
+ 'and will be not be allowed in the next major version. Use key() without the third parameter.',
E_USER_DEPRECATED
);
}
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 3257a8c0d..a913d82ce 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -16,7 +16,10 @@
- tests/integration/
+ tests/feature/
+
+
+ tests/Pest.php
@@ -26,7 +29,4 @@
-
- tests/integration/
-
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 603926219..43e2a2696 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -7,28 +7,32 @@ parameters:
# Why: SimpleXMLElement is weird and doesn't implement anything ArrayAccess-like
message: '/Instanceof between mixed and SimpleXMLElement will always evaluate to false\./'
path: library/Rules/ArrayVal.php
+ - message: '/Call to an undefined method .+::skip\(\)/'
+ path: tests/feature
+ - message: '/Call to an undefined method .+::expectException\(\)/'
+ path: tests/Pest.php
- message: '/Call to deprecated method optional\(\).+/'
- path: tests/integration/transformers/aliases.phpt
+ path: tests/feature/Transformers/AliasesTest.php
- message: '/Call to an undefined static method Respect\\Validation\\Validator::(min|max)Age\(\)./'
- path: tests/integration/transformers/deprecated_age.phpt
+ path: tests/feature/Transformers/DeprecatedAgeTest.php
- message: '/Call to an undefined static method Respect\\Validation\\Validator::attribute\(\)./'
- path: tests/integration/transformers/deprecated_attribute.phpt
+ path: tests/feature/Transformers/DeprecatedAttributeTest.php
- message: '/Static method Respect\\Validation\\Mixins\\StaticValidator::key\(\) invoked with \d parameters?, 2 required/'
- path: tests/integration/transformers/deprecated_key.phpt
+ path: tests/feature/Transformers/DeprecatedKeyTest.php
- message: '/Call to an undefined static method Respect\\Validation\\Validator::keyNested\(\)./'
- path: tests/integration/transformers/deprecated_keyNested.phpt
+ path: tests/feature/Transformers/DeprecatedKeyNestedTest.php
- message: '/Call to an undefined static method Respect\\Validation\\Validator::keyValue\(\)./'
- path: tests/integration/transformers/deprecated_keyValue.phpt
+ path: tests/feature/Transformers/DeprecatedKeyValueTest.php
- message: '/Parameter #1 \$rule of static method Respect\\Validation\\Mixins\\StaticValidator::length\(\) expects Respect\\Validation\\Rule.+/'
- path: tests/integration/transformers/deprecated_length.phpt
+ path: tests/feature/Transformers/DeprecatedLengthTest.php
- message: '/Static method Respect\\Validation\\Mixins\\StaticValidator::length\(\) invoked with \d parameters, 1 required/'
- path: tests/integration/transformers/deprecated_length.phpt
+ path: tests/feature/Transformers/DeprecatedLengthTest.php
- message: '/Parameter #1 \$rule of static method Respect\\Validation\\Mixins\\StaticValidator::max\(\) expects Respect\\Validation\\Rule.+/'
- path: tests/integration/transformers/deprecated_max.phpt
+ path: tests/feature/Transformers/DeprecatedMaxTest.php
- message: '/Parameter #1 \$rule of static method Respect\\Validation\\Mixins\\StaticValidator::min\(\) expects Respect\\Validation\\Rule.+/'
- path: tests/integration/transformers/deprecated_min.phpt
+ path: tests/feature/Transformers/DeprecatedMinTest.php
- message: '/Call to an undefined static method Respect\\Validation\\Validator::type\(\)./'
- path: tests/integration/transformers/deprecated_type.phpt
+ path: tests/feature/Transformers/DeprecatedTypeTest.php
- message: '/Method .+\\TestingStringifier::stringify\(\) never returns null so it can be removed from the return type./'
path: tests/library/Message/TestingStringifier.php
- message: '/Parameter #1 \$messages of class .+\\ArrayTranslator constructor expects array, array given./'
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 949e8c279..644ad9fbf 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -11,8 +11,8 @@
tests/unit/
-
- tests/integration/
+
+ ./tests/feature