Skip to content

Commit

Permalink
✅ Update events test with error details payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McIntosh committed Apr 2, 2024
1 parent 423cc08 commit 2ae347b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/Resource/EventsResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ public function testCreateValidationError(): void
400,
[
'errno' => 3,
'message' => 'The request was well-formed but was unable to be followed due to semantic errors.'
. '\nevent: Value error, Unrecognized event.'
'message' => 'The request was well-formed but was unable to be followed due to semantic errors.',
'details' => [
'event: Value error, Unrecognized event.'
]
]
);

Expand All @@ -82,11 +84,11 @@ public function testCreateValidationError(): void
$resource->create($this->accountId, data: []);
$this->fail('FreshBooksException was not thrown');
} catch (FreshBooksException $e) {
$this->assertSame('The request was well-formed but was unable to be followed due to semantic errors.'
. '\nevent: Value error, Unrecognized event.', $e->getMessage());
$this->assertSame('The request was well-formed but was unable to be followed due '
. 'to semantic errors.', $e->getMessage());
$this->assertSame(400, $e->getCode());
$this->assertNull($e->getErrorCode());
$this->assertSame([], $e->getErrorDetails());
$this->assertSame(['event: Value error, Unrecognized event.'], $e->getErrorDetails());
}
}

Expand Down

0 comments on commit 2ae347b

Please sign in to comment.