Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 3aaa5dd

Browse files
committed
test(RamlModel): fix raml model test if not property type is set
1 parent 2be1ece commit 3aaa5dd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Core/Model/Project/SearchIndexingConfigurationValues.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public function fieldDefinitions()
2525
'status' => [static::TYPE => 'string', static::OPTIONAL => true],
2626
'lastModifiedAt' => [
2727
static::TYPE => DateTime::class,
28-
static::OPTIONAL => true,
2928
static::DECORATOR => DateTimeDecorator::class
3029
],
3130
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class, static::OPTIONAL => true],

tests/unit/Model/RamlModelTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public function modelFieldType($className, array $validFields = [])
6767
$t = new \ReflectionClass($className);
6868
$wrongTypes = [];
6969
foreach ($this->fieldDefinitions($className) as $fieldKey => $field) {
70+
if (!isset($validFields[$fieldKey]['type'])) {
71+
continue;
72+
}
7073
$expectedFieldType = $validFields[$fieldKey]['type'];
7174
if ($validFields[$fieldKey]['type'] === 'number' && isset($validFields[$fieldKey]['format'])) {
7275
$expectedFieldType = $validFields[$fieldKey]['format'];

0 commit comments

Comments
 (0)