Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 502daa6

Browse files
author
Jonathan RIBAS
committed
add store configs endpoint
1 parent ff2920e commit 502daa6

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,15 @@ Get a list of paginated stocks.
460460
Magento::api('stocks')->all($pageSize = 50, $currentPage = 1, $filters = []);
461461
```
462462

463+
### Store (storeGroupRepositoryV1)
464+
465+
`/V1/store/storeConfigs`
466+
467+
Get a list of store configs.
468+
```php
469+
Magento::api('store')->storeConfigs();
470+
```
471+
463472
## Testing
464473

465474
``` bash

src/Api/Store.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Grayloon\Magento\Api;
4+
5+
class Store extends AbstractApi
6+
{
7+
/**
8+
* Retrieve list of all store configs.
9+
*
10+
* @return array
11+
*/
12+
public function storeConfigs()
13+
{
14+
return $this->get('/store/storeConfigs');
15+
}
16+
}

tests/Api/StoreTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Grayloon\Magento\Tests;
4+
5+
use Grayloon\Magento\Api\Store;
6+
use Grayloon\Magento\MagentoFacade;
7+
use Illuminate\Support\Facades\Http;
8+
9+
class StoreTest extends TestCase
10+
{
11+
public function test_can_instantiate_store()
12+
{
13+
$this->assertInstanceOf(Stores::class, MagentoFacade::api('store'));
14+
}
15+
16+
public function test_can_call_store_store_configs()
17+
{
18+
Http::fake([
19+
'*rest/all/V1/store/storeConfigs*' => Http::response([], 200),
20+
]);
21+
22+
$api = MagentoFacade::api('store')->storeConfigs();
23+
24+
$this->assertTrue($api->ok());
25+
}
26+
}

0 commit comments

Comments
 (0)