Skip to content

Commit

Permalink
Ensure relationship name is also augmented
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Dec 26, 2023
1 parent 114d0e5 commit 4f6d91d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Data/AugmentedModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public function it_gets_values()
$this->assertEquals('2020-01-01 13:46:12', $augmented->get('created_at')->value()->format('Y-m-d H:i:s'));
$this->assertEquals('/posts/my-first-post', $augmented->get('url')->value());

$this->assertIsArray($augmented->get('author')->value());
$this->assertEquals($author->id, $augmented->get('author')->value()['id']->value());
$this->assertEquals('John Doe', $augmented->get('author')->value()['name']->value());

$this->assertIsArray($augmented->get('author_id')->value());
$this->assertEquals($author->id, $augmented->get('author_id')->value()['id']->value());
$this->assertEquals('John Doe', $augmented->get('author_id')->value()['name']->value());
Expand Down

0 comments on commit 4f6d91d

Please sign in to comment.