|
@@ 729-752 (lines=24) @@
|
| 726 |
|
* |
| 727 |
|
* @dataProvider provideInvalidFieldSettings |
| 728 |
|
*/ |
| 729 |
|
public function testValidateFieldSettingsInvalid($inputSettings) |
| 730 |
|
{ |
| 731 |
|
$fieldType = $this->getFieldTypeUnderTest(); |
| 732 |
|
|
| 733 |
|
$validationResult = $fieldType->validateFieldSettings($inputSettings); |
| 734 |
|
|
| 735 |
|
$this->assertIsArray($validationResult, |
| 736 |
|
'The method validateFieldSettings() must return an array.' |
| 737 |
|
); |
| 738 |
|
|
| 739 |
|
$this->assertNotEquals( |
| 740 |
|
[], |
| 741 |
|
$validationResult, |
| 742 |
|
'validateFieldSettings() did consider the input settings valid, which should be invalid.' |
| 743 |
|
); |
| 744 |
|
|
| 745 |
|
foreach ($validationResult as $actualResultElement) { |
| 746 |
|
$this->assertInstanceOf( |
| 747 |
|
ValidationError::class, |
| 748 |
|
$actualResultElement, |
| 749 |
|
'Validation result of incorrect type.' |
| 750 |
|
); |
| 751 |
|
} |
| 752 |
|
} |
| 753 |
|
|
| 754 |
|
/** |
| 755 |
|
* @param mixed $inputConfiguration |
|
@@ 780-803 (lines=24) @@
|
| 777 |
|
* |
| 778 |
|
* @dataProvider provideInvalidValidatorConfiguration |
| 779 |
|
*/ |
| 780 |
|
public function testValidateValidatorConfigurationInvalid($inputConfiguration) |
| 781 |
|
{ |
| 782 |
|
$fieldType = $this->getFieldTypeUnderTest(); |
| 783 |
|
|
| 784 |
|
$validationResult = $fieldType->validateValidatorConfiguration($inputConfiguration); |
| 785 |
|
|
| 786 |
|
$this->assertIsArray($validationResult, |
| 787 |
|
'The method validateValidatorConfiguration() must return an array.' |
| 788 |
|
); |
| 789 |
|
|
| 790 |
|
$this->assertNotEquals( |
| 791 |
|
[], |
| 792 |
|
$validationResult, |
| 793 |
|
'validateValidatorConfiguration() did consider the input settings valid, which should be invalid.' |
| 794 |
|
); |
| 795 |
|
|
| 796 |
|
foreach ($validationResult as $actualResultElement) { |
| 797 |
|
$this->assertInstanceOf( |
| 798 |
|
ValidationError::class, |
| 799 |
|
$actualResultElement, |
| 800 |
|
'Validation result of incorrect type.' |
| 801 |
|
); |
| 802 |
|
} |
| 803 |
|
} |
| 804 |
|
|
| 805 |
|
/** |
| 806 |
|
* @param mixed $inputConfiguration |