Skip to content

Commit 70677eb

Browse files
committed
product price table tests
1 parent 2c31821 commit 70677eb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/Endpoints/Products.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use JulianoBailao\DomusApi\Contracts\GetContract;
77
use JulianoBailao\DomusApi\Core\Endpoint;
88
use JulianoBailao\DomusApi\Data\ProductData;
9+
use JulianoBailao\DomusApi\Endpoints\Secondary\ProductPriceTable;
910

1011
class Products extends Endpoint implements GetContract, CreationContract
1112
{

tests/ProductTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,20 @@ public function testDelete()
5454

5555
$this->assertEquals($client->products()->delete(1), FakeHandler::getJson('product_get'));
5656
}
57+
58+
public function testPriceTabePaginate()
59+
{
60+
$client = new Client('foo.bar', '8080', 'username', 'password');
61+
$client->setHandler(FakeHandler::mockResponses('login', 'branch', 'product_paginate'));
62+
63+
$this->assertEquals($client->products()->priceTableInfo()->paginate(), FakeHandler::getJson('product_paginate'));
64+
}
65+
66+
public function testPriceTabeGet()
67+
{
68+
$client = new Client('foo.bar', '8080', 'username', 'password');
69+
$client->setHandler(FakeHandler::mockResponses('login', 'branch', 'product_get'));
70+
71+
$this->assertEquals($client->products()->priceTableInfo()->get(12345), FakeHandler::getJson('product_get'));
72+
}
5773
}

0 commit comments

Comments
 (0)