Skip to content

Commit

Permalink
添加获取微信支持的门店类目表
Browse files Browse the repository at this point in the history
创建门店时,必须填入微信支持格式的门店类目, 所以需要先获得支持的门店类目
点击查看[微信创建门店文档](https://mp.weixin.qq.com/wiki?action=doc&id=mp1444378120&t=0.3682459036774999#mdlmb)
  • Loading branch information
张哲 committed Mar 31, 2017
1 parent 9e1a727 commit 8cea3ee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/POI/POI.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ class POI extends AbstractAPI
const API_LIST = 'http://api.weixin.qq.com/cgi-bin/poi/getpoilist';
const API_UPDATE = 'http://api.weixin.qq.com/cgi-bin/poi/updatepoi';
const API_DELETE = 'http://api.weixin.qq.com/cgi-bin/poi/delpoi';
const API_GET_CATEGORIES = 'http://api.weixin.qq.com/cgi-bin/poi/getwxcategory';


/**
* Get POI supported categories.
*
* @return \EasyWeChat\Support\Collection
*/
public function getCategories()
{
return $this->parseJSON('get', [self::API_GET_CATEGORIES]);
}

/**
* Get POI by ID.
Expand Down
11 changes: 11 additions & 0 deletions tests/POI/POIPOITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ public function getPOI()
return $POI;
}

/**
* Test getCategories().
*/
public function testGetCategories()
{
$POI = $this->getPOI();

$response = $POI->getCategories();
$this->assertStringStartsWith(POI::API_GET_CATEGORIES, $response['api']);
}

/**
* Test get().
*/
Expand Down

0 comments on commit 8cea3ee

Please sign in to comment.