diff --git a/src/Api/Store.php b/src/Api/Store.php index 2d70bef..b28995e 100644 --- a/src/Api/Store.php +++ b/src/Api/Store.php @@ -13,4 +13,14 @@ public function storeConfigs() { return $this->get('/store/storeConfigs'); } + + /** + * Retrieve list of all websites. + * + * @return array + */ + public function websites() + { + return $this->get('/store/websites'); + } } diff --git a/src/Api/Stores.php b/src/Api/Stores.php deleted file mode 100644 index 3ca80b6..0000000 --- a/src/Api/Stores.php +++ /dev/null @@ -1,16 +0,0 @@ -get('/store/websites'); - } -} diff --git a/tests/Api/StoreTest.php b/tests/Api/StoreTest.php index e8e0ff2..d244c2f 100644 --- a/tests/Api/StoreTest.php +++ b/tests/Api/StoreTest.php @@ -23,4 +23,15 @@ public function test_can_call_store_store_configs() $this->assertTrue($api->ok()); } + + public function test_can_call_stores_websites() + { + Http::fake([ + '*rest/all/V1/store/websites*' => Http::response([], 200), + ]); + + $api = MagentoFacade::api('store')->websites(); + + $this->assertTrue($api->ok()); + } } diff --git a/tests/Api/StoresTest.php b/tests/Api/StoresTest.php deleted file mode 100644 index 86a4ed2..0000000 --- a/tests/Api/StoresTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertInstanceOf(Stores::class, MagentoFacade::api('stores')); - } - - public function test_can_call_stores_websites() - { - Http::fake([ - '*rest/all/V1/store/websites*' => Http::response([], 200), - ]); - - $api = MagentoFacade::api('stores')->websites(); - - $this->assertTrue($api->ok()); - } -}