Skip to content

Commit

Permalink
Fixed an issue where meta content was not being displayed (process() …
Browse files Browse the repository at this point in the history
…was not propagated)
  • Loading branch information
elb98rm committed Jan 27, 2023
1 parent a9c9025 commit 22f90eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Models/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function process(): array
}

if($this->getMeta()) {
$return['meta'] = $this->getMeta();
$return['meta'] = $this->getMeta()->process();
}

// Spec 11.2 : An error object MAY have the following members, and MUST contain at least one of...
Expand Down
8 changes: 7 additions & 1 deletion tests/Unit/ErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public function testProcess()
$array['meta']
);

// meta is processed
$array['meta'] = $array['meta']->process();

$this->assertEquals($error->process(), $array);
}

Expand Down Expand Up @@ -152,8 +155,11 @@ public function testProcessNullProperties()
$array['meta']
);

// meta is processed
$array['meta'] = $array['meta']->process();

// should do nothing
$this->assertEquals($error->process(), $array);
$this->assertEquals($array, $error->process());

// remove one by one, then check
$error->setId(null);
Expand Down

0 comments on commit 22f90eb

Please sign in to comment.