Skip to content

Commit

Permalink
增加小程序联盟查询联盟精选商品接口 (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abbotton committed Jun 29, 2021
1 parent dffd158 commit e331782
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/MiniProgram/Union/Client.php
Expand Up @@ -173,4 +173,17 @@ public function searchOrder(int $page = 1, $startTimestamp = '', $endTimestamp =

return $this->httpGet('union/promoter/order/search', $params);
}

/**
* Get featured products of union.
*
* @param array $params
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getFeaturedProducts(array $params)
{
return $this->httpGet('union/promoter/product/select', $params);
}
}
15 changes: 15 additions & 0 deletions tests/MiniProgram/Union/ClientTest.php
Expand Up @@ -130,4 +130,19 @@ public function testSearchOrder()

$this->assertSame('mock-result', $response);
}

public function testGetFeaturedProducts()
{
$client = $this->mockApiClient(Client::class);
$params = [
'from' => 0,
'limit' => 10,
'minPrice' => 1
];

$client->expects()->httpGet('union/promoter/product/select', $params)->andReturn('mock-result');
$response = $client->getFeaturedProducts($params);

$this->assertSame('mock-result', $response);
}
}

0 comments on commit e331782

Please sign in to comment.