From 26ec49e6986d9f7e3073542e6b22033f3783f66f Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Tue, 15 Aug 2023 17:28:52 -0600 Subject: [PATCH] tests: assign response code outside of object construction --- .../files/etc/inc/api/tests/APICoreResponseTestCase.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pfSense-pkg-API/files/etc/inc/api/tests/APICoreResponseTestCase.inc b/pfSense-pkg-API/files/etc/inc/api/tests/APICoreResponseTestCase.inc index 1037b4cfc..297062845 100644 --- a/pfSense-pkg-API/files/etc/inc/api/tests/APICoreResponseTestCase.inc +++ b/pfSense-pkg-API/files/etc/inc/api/tests/APICoreResponseTestCase.inc @@ -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(), [ @@ -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(), [