Skip to content

Commit

Permalink
APIv4 - GetFields test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Jan 23, 2024
1 parent 4d2c402 commit 235963e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/phpunit/api/v4/Entity/ConformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,11 @@ protected function checkFields($entityName) {

// Ensure that the getFields (FieldSpec) format is generally consistent.
foreach ($fields as $field) {
$isNotNull = function($v) {
return $v !== NULL;
};
$class = empty($field['custom_field_id']) ? FieldSpec::class : CustomFieldSpec::class;
$spec = (new $class($field['name'], $field['entity']))->loadArray($field, TRUE);
$this->assertEquals(
array_filter($field, $isNotNull),
array_filter($spec->toArray(), $isNotNull)
array_filter($field),
array_filter($spec->toArray())
);
}
}
Expand Down

0 comments on commit 235963e

Please sign in to comment.