Skip to content

Commit

Permalink
tests: assign response code outside of object construction
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhendrickson13 committed Aug 15, 2023
1 parent aa395c7 commit 26ec49e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class APICoreResponseTestCase extends API\Core\TestCase {
public function test_response_to_representation() {
$response = new API\Core\Response(
message: "Test message",
response_id: "TEST_RESPONSE_ID",
code: 500
response_id: "TEST_RESPONSE_ID"
);
$response->code = 500;
$this->assert_equals(
$response->to_representation(),
[
Expand All @@ -59,9 +59,10 @@ class APICoreResponseTestCase extends API\Core\TestCase {
$response = new API\Core\Response(
message: "Test message 2",
response_id: "TEST_RESPONSE_ID2",
code: 400,
data: ["test_data_field" => "test_data_value"]
);
$response->code = 400;

$this->assert_equals(
$response->to_representation(),
[
Expand Down

0 comments on commit 26ec49e

Please sign in to comment.