revised code
This commit is contained in:
parent
c09b13c124
commit
1fd6480cd2
2 changed files with 14 additions and 11 deletions
|
@ -22,9 +22,9 @@ class SettingsValidatorTest extends FunctionalTestCase
|
||||||
{
|
{
|
||||||
$result = $this->objectManager->get(SettingsValidator::class)->validate(new TestObject());
|
$result = $this->objectManager->get(SettingsValidator::class)->validate(new TestObject());
|
||||||
|
|
||||||
$this->assertTrue($result->hasErrors());
|
self::assertTrue($result->hasErrors());
|
||||||
$this->assertCount(1, $result->getFlattenedErrors());
|
self::assertCount(1, $result->getFlattenedErrors());
|
||||||
$this->assertCount(1, $result->forProperty('shouldBeFalse')->getErrors());
|
self::assertCount(1, $result->forProperty('shouldBeFalse')->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,8 +40,8 @@ class SettingsValidatorTest extends FunctionalTestCase
|
||||||
->getBaseValidatorConjunction(TestObject::class)
|
->getBaseValidatorConjunction(TestObject::class)
|
||||||
->validate(new TestObject());
|
->validate(new TestObject());
|
||||||
|
|
||||||
$this->assertTrue($result->hasErrors());
|
self::assertTrue($result->hasErrors());
|
||||||
$this->assertCount(1, $result->getFlattenedErrors());
|
self::assertCount(1, $result->getFlattenedErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,9 +54,9 @@ class SettingsValidatorTest extends FunctionalTestCase
|
||||||
->get(SettingsValidator::class, ['validationGroups' => ['Default']])
|
->get(SettingsValidator::class, ['validationGroups' => ['Default']])
|
||||||
->validate(new TestValidationGroupsDefaultObject());
|
->validate(new TestValidationGroupsDefaultObject());
|
||||||
|
|
||||||
$this->assertTrue($result->hasErrors(), 'No errors for validation group "Default"');
|
self::assertTrue($result->hasErrors(), 'No errors for validation group "Default"');
|
||||||
$this->assertCount(1, $result->getFlattenedErrors(), 'Got a non expected number of errors for group "Default"');
|
self::assertCount(1, $result->getFlattenedErrors(), 'Got a non expected number of errors for group "Default"');
|
||||||
$this->assertCount(1, $result->forProperty('shouldBeTrue')->getErrors(), 'Got no error for property');
|
self::assertCount(1, $result->forProperty('shouldBeTrue')->getErrors(), 'Got no error for property');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,8 +69,8 @@ class SettingsValidatorTest extends FunctionalTestCase
|
||||||
->get(SettingsValidator::class, ['validationGroups' => ['Custom']])
|
->get(SettingsValidator::class, ['validationGroups' => ['Custom']])
|
||||||
->validate(new TestValidationGroupsCustomObject());
|
->validate(new TestValidationGroupsCustomObject());
|
||||||
|
|
||||||
$this->assertTrue($result->hasErrors(), 'No errors for validation group "Custom"');
|
self::assertTrue($result->hasErrors(), 'No errors for validation group "Custom"');
|
||||||
$this->assertCount(1, $result->getFlattenedErrors(), 'Got a non expected number of errors for group "Custom"');
|
self::assertCount(1, $result->getFlattenedErrors(), 'Got a non expected number of errors for group "Custom"');
|
||||||
$this->assertCount(1, $result->forProperty('shouldBeFalse')->getErrors(), 'Got no error for property');
|
self::assertCount(1, $result->forProperty('shouldBeFalse')->getErrors(), 'Got no error for property');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
"neos/flow": "^6.3.5",
|
"neos/flow": "^6.3.5",
|
||||||
"php": ">=7.4"
|
"php": ">=7.4"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~8.5"
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"DigiComp\\SettingValidator\\": "Classes/"
|
"DigiComp\\SettingValidator\\": "Classes/"
|
||||||
|
|
Loading…
Add table
Reference in a new issue