feature/drone-ci-tests #1

Merged
fkuhl merged 4 commits from :feature/drone-ci-tests into feature/drone-ci-tests 2022-04-30 18:36:20 +02:00
4 changed files with 58 additions and 8 deletions

View file

@ -4,4 +4,4 @@ pipeline:
commands: commands:
- composer global config repositories.repo-name vcs https://git.digital-competence.de/Packages/php-codesniffer - composer global config repositories.repo-name vcs https://git.digital-competence.de/Packages/php-codesniffer
- composer global require digicomp/php-codesniffer:@dev - composer global require digicomp/php-codesniffer:@dev
- composer global exec -- phpcs --standard=DigiComp . - composer global exec -- phpcs --runtime-set ignore_warnings_on_exit 1 --standard=DigiComp Classes/ Migrations/ Tests/ Resources/Private/

46
.woodpecker/test.yml Normal file
View file

@ -0,0 +1,46 @@
workspace:
base: /woodpecker
path: package
matrix:
FLOW_VERSION:
- 4.3
- 5.3
pipeline:
functional-tests:
image: thecodingmachine/php:7.4-v4-cli
environment:
# Enable the PDO_SQLITE extension
- "PHP_EXTENSION_PDO_SQLITE=1"
- "FLOW_VERSION=${FLOW_VERSION}"
- "NEOS_BUILD_DIR=/woodpecker/Build-${FLOW_VERSION}"
commands:
- "sudo mkdir $NEOS_BUILD_DIR"
- "sudo chown -R docker:docker $NEOS_BUILD_DIR"
- "cd $NEOS_BUILD_DIR"
- "if [ \"$FLOW_VERSION\" = \"4.3\" ]; then sudo composer self-update --1; fi"
- "composer create-project --no-install neos/flow-base-distribution:^$FLOW_VERSION ."
- "composer config repositories.repo-name path /woodpecker/package"
- "composer remove --dev neos/behat"
- "if [ \"$FLOW_VERSION\" = \"4.3\" ]; then composer require typo3fluid/fluid:2.4.3; fi"
- "composer require digicomp/settingvalidator:@dev"
- |
if [ "$FLOW_VERSION" = "4.3" ]; then
echo 'Neos:
Flow:
persistence:
backendOptions:
dbname: "flow_functional_testing"
error:
errorHandler:
exceptionalErrors:
0: "%E_USER_ERROR%"
1: "%E_RECOVERABLE_ERROR%"
2: ~
3: "%E_NOTICE%"
4: "%E_USER_WARNING%"
5: "%E_USER_NOTICE%"
6: "%E_STRICT%"' > Configuration/Testing/Settings.yaml
fi
- "bin/phpunit --configuration Build/BuildEssentials/PhpUnit/FunctionalTests.xml Packages/Application/DigiComp.SettingValidator/Tests/Functional"

View file

@ -28,8 +28,8 @@ use Neos\Utility\TypeHandling;
class SettingsValidator extends AbstractValidator class SettingsValidator extends AbstractValidator
{ {
/** /**
* @var ValidatorResolver
* @Flow\Inject * @Flow\Inject
* @var ValidatorResolver
*/ */
protected $validatorResolver; protected $validatorResolver;
@ -39,9 +39,9 @@ class SettingsValidator extends AbstractValidator
protected $configurationManager; protected $configurationManager;
/** /**
* @var ReflectionService
* @Flow\Inject * @Flow\Inject
* @deprecated * @deprecated
* @var ReflectionService
*/ */
protected $reflectionService; protected $reflectionService;
@ -54,7 +54,7 @@ class SettingsValidator extends AbstractValidator
['Default'], ['Default'],
'Same as "Validation Groups" of Flow Framework. Defines the groups to execute.', 'Same as "Validation Groups" of Flow Framework. Defines the groups to execute.',
'array', 'array',
false false,
], ],
]; ];
@ -107,7 +107,7 @@ class SettingsValidator extends AbstractValidator
if (! $validator) { if (! $validator) {
throw new InvalidValidationConfigurationException( throw new InvalidValidationConfigurationException(
sprintf( \sprintf(
'Validator could not be resolved: "%s" Check your Validation.yaml', 'Validator could not be resolved: "%s" Check your Validation.yaml',
$validatorConfig['validator'] $validatorConfig['validator']
), ),
@ -135,7 +135,7 @@ class SettingsValidator extends AbstractValidator
$config = []; $config = [];
if (isset($this->validations[$name]['self'])) { if (isset($this->validations[$name]['self'])) {
foreach ($this->validations[$name]['self'] as $validator => &$validation) { foreach ($this->validations[$name]['self'] as $validator => &$validation) {
if (is_null($validation)) { if ($validation === null) {
continue; continue;
} }
$newValidation['options'] = $validation; $newValidation['options'] = $validation;
@ -146,7 +146,7 @@ class SettingsValidator extends AbstractValidator
if (isset($this->validations[$name]['properties'])) { if (isset($this->validations[$name]['properties'])) {
foreach ($this->validations[$name]['properties'] as $propertyName => &$validation) { foreach ($this->validations[$name]['properties'] as $propertyName => &$validation) {
foreach ($validation as $validator => &$options) { foreach ($validation as $validator => &$options) {
if (is_null($options)) { if ($options === null) {
continue; continue;
} }
$newValidation['property'] = $propertyName; $newValidation['property'] = $propertyName;
@ -168,7 +168,10 @@ class SettingsValidator extends AbstractValidator
*/ */
protected function doesValidationGroupsMatch(array &$validatorConfig) protected function doesValidationGroupsMatch(array &$validatorConfig)
{ {
if (isset($validatorConfig['options']['validationGroups']) && empty(array_intersect($validatorConfig['options']['validationGroups'], $this->options['validationGroups']))) { if (
isset($validatorConfig['options']['validationGroups'])
&& \array_intersect($validatorConfig['options']['validationGroups'], $this->options['validationGroups']) === []
) {
return false; return false;
} }

View file

@ -1,4 +1,5 @@
<?php <?php
namespace Neos\Flow\Core\Migrations; namespace Neos\Flow\Core\Migrations;
/* /*