This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Grayloon \Magento \Tests ;
4+
5+ use Grayloon \Magento \Api \Sources ;
6+ use Grayloon \Magento \MagentoFacade ;
7+ use Illuminate \Support \Facades \Http ;
8+
9+ class SourcesTest extends TestCase
10+ {
11+ public function test_can_instantiate_sources ()
12+ {
13+ $ this ->assertInstanceOf (Sources::class, MagentoFacade::api ('sources ' ));
14+ }
15+
16+ public function test_can_call_sources_all ()
17+ {
18+ Http::fake ([
19+ '*rest/all/V1/inventory/sources* ' => Http::response ([], 200 ),
20+ ]);
21+
22+ $ api = MagentoFacade::api ('sources ' )->all ();
23+
24+ $ this ->assertTrue ($ api ->ok ());
25+ }
26+
27+ public function test_can_call_sources_by_source_name ()
28+ {
29+ Http::fake ([
30+ '*rest/all/V1/inventory/sources/default* ' => Http::response ([], 200 ),
31+ ]);
32+
33+ $ api = MagentoFacade::api ('sources ' )->bySourceName ();
34+
35+ $ this ->assertTrue ($ api ->ok ());
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Grayloon \Magento \Tests ;
4+
5+ use Grayloon \Magento \Api \Stocks ;
6+ use Grayloon \Magento \Api \Sources ;
7+ use Grayloon \Magento \MagentoFacade ;
8+ use Illuminate \Support \Facades \Http ;
9+
10+ class StocksTest extends TestCase
11+ {
12+ public function test_can_instantiate_stocks ()
13+ {
14+ $ this ->assertInstanceOf (Stocks::class, MagentoFacade::api ('stocks ' ));
15+ }
16+
17+ public function test_can_call_stocks_all ()
18+ {
19+ Http::fake ([
20+ '*rest/all/V1/inventory/stocks* ' => Http::response ([], 200 ),
21+ ]);
22+
23+ $ api = MagentoFacade::api ('stocks ' )->all ();
24+
25+ $ this ->assertTrue ($ api ->ok ());
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments