Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gam6itko committed Jul 14, 2020
1 parent cc9efed commit 5c60cc1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

# 0.4.1
- ProductValidator для экспорта товаров V2. При создании экземпляра объекта необходимо передать вторым аргументом версию API.
- CategoryService::attributeValues возвращает массив содержащий ключи [result, has_next].


# 0.4.0
- При создании экземпляра Service-класса необходимо передать объект класса `Psr\Http\Client\ClientInterface`.


# 0.3.0
- Удалены `deprecated` методы.
- declare(strict_types=1);
Expand Down
21 changes: 20 additions & 1 deletion tests/Service/V2/CategoryServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ public function testAttribute(): void

public function testAttributeValues()
{
$responseJson = <<<JSON
{
"result": [
{
"id": 115845746,
"value": "President",
"picture": "http://cdn1.ozone.ru/multimedia/1029443311.jpg",
"info": "Продукты питания"
}
],
"has_next": true
}
JSON;

$this->quickTest(
'attributeValues',
[
Expand All @@ -41,7 +55,12 @@ public function testAttributeValues()
'POST',
'/v2/category/attribute/values',
'{"category_id":17036076,"attribute_id":8229,"limit":1,"last_value_id":0,"language":"EN"}',
]
],
$responseJson,
function (array $result) {
self::assertArrayHasKey('result', $result);
self::assertArrayHasKey('has_next', $result);
}
);
}

Expand Down

0 comments on commit 5c60cc1

Please sign in to comment.