From 06eda073bf2594c8c99ee8b5e3451a291e03c09c Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 27 Sep 2020 10:23:17 +0200 Subject: [PATCH] Added API test for /domains endpoint --- .../Rest/test-api/Action/ListDomainsTest.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 module/Rest/test-api/Action/ListDomainsTest.php diff --git a/module/Rest/test-api/Action/ListDomainsTest.php b/module/Rest/test-api/Action/ListDomainsTest.php new file mode 100644 index 00000000..045197e8 --- /dev/null +++ b/module/Rest/test-api/Action/ListDomainsTest.php @@ -0,0 +1,37 @@ +callApiWithKey(self::METHOD_GET, '/domains'); + $respPayload = $this->getJsonResponsePayload($resp); + + self::assertEquals(self::STATUS_OK, $resp->getStatusCode()); + self::assertEquals([ + 'domains' => [ + 'data' => [ + [ + 'domain' => 'doma.in', + 'isDefault' => true, + ], + [ + 'domain' => 'example.com', + 'isDefault' => false, + ], + [ + 'domain' => 'some-domain.com', + 'isDefault' => false, + ], + ], + ], + ], $respPayload); + } +}