diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf02210..0ff16e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,3 +9,15 @@ jobs: ci: name: CI uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 + with: + extra_jobs: | + - php: 8.0 + phpunit: false + endtoend: true + endtoend_suite: admin + endtoend_config: vendor/silverstripe/admin/behat.yml + - php: 8.1 + phpunit: false + endtoend: true + endtoend_suite: cms + endtoend_config: vendor/silverstripe/cms/behat.yml diff --git a/_config/config.yml b/_config/config.yml index c8dfb85..23b0cb6 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -10,3 +10,8 @@ Signify\ComposableValidators\Validators\SimpleFieldsValidator: SilverStripe\Admin\LeftAndMain: extra_requirements_css: - 'guysartorelli/silverstripe-composable-validators:client/dist/left-and-main.css' + +# Replace new FieldsValidator with our SimpleFieldsValidator +SilverStripe\Core\Injector\Injector: + SilverStripe\Forms\FieldsValidator: + class: Signify\ComposableValidators\Validators\SimpleFieldsValidator diff --git a/composer.json b/composer.json index c4baeb0..271c89d 100644 --- a/composer.json +++ b/composer.json @@ -41,11 +41,12 @@ }, "require": { "php": "^7.3 || ^8.0", - "silverstripe/framework": "^4.10.0", + "silverstripe/framework": "^4.13.18", "signify-nz/silverstripe-searchfilter-arraylist": "^1.0.0" }, "require-dev": { "silverstripe/cms": "^4.0", + "silverstripe/frameworktest": "^0.4.13", "silverstripe/asset-admin": "^1.6", "dnadesign/silverstripe-elemental": "^4.0", "phpunit/phpunit": "^9.5", diff --git a/src/Validators/SimpleFieldsValidator.php b/src/Validators/SimpleFieldsValidator.php index fe78de3..8dbb6f3 100644 --- a/src/Validators/SimpleFieldsValidator.php +++ b/src/Validators/SimpleFieldsValidator.php @@ -2,7 +2,7 @@ namespace Signify\ComposableValidators\Validators; -use SilverStripe\Forms\Validator; +use SilverStripe\Forms\FieldsValidator; /** * A validator to ensure that all form fields are internally valid. @@ -13,7 +13,7 @@ * This class is to avoid the use of, say, RequiredFields::create([]), which * relies on an implementation detail to ensure that fields are validated. */ -class SimpleFieldsValidator extends Validator +class SimpleFieldsValidator extends FieldsValidator { /** * Array of FormField subclasses that shouldn't be validated in AJAX validation calls. @@ -29,7 +29,7 @@ class SimpleFieldsValidator extends Validator * @param array $data * @return bool */ - public function php($data, bool $isAjax = false) + public function php($data, bool $isAjax = false): bool { $valid = true; $fields = $this->form->Fields();