Skip to content

Commit

Permalink
Fix openid tests. #467
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jul 21, 2016
1 parent 9248db6 commit 8624907
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/User/Tag.php
Expand Up @@ -120,7 +120,7 @@ public function userTags($openId)
*
* @return int
*/
public function usersOfTag($tagId, $nextOpenId)
public function usersOfTag($tagId, $nextOpenId = '')
{
$params = ['tagid' => $tagId, 'next_openid' => $nextOpenId];

Expand Down
10 changes: 8 additions & 2 deletions tests/User/UserTagTest.php
Expand Up @@ -100,9 +100,15 @@ public function testUsersOfTag()
{
$tag = $this->getTag();

$tag->shouldReceive('parseJSON')->withArgs(['json', [Tag::API_USERS_OF_TAG, ['tagid' => 'thetagid']]])->once();

$tag->shouldReceive('parseJSON')
->withArgs(['json', [Tag::API_USERS_OF_TAG, ['tagid' => 'thetagid', 'next_openid' => '']]])
->once();
$result = $tag->usersOfTag('thetagid');

$tag->shouldReceive('parseJSON')
->withArgs(['json', [Tag::API_USERS_OF_TAG, ['tagid' => 'thetagid', 'next_openid' => 'foo']]])
->once();
$result = $tag->usersOfTag('thetagid', 'foo');
}

/**
Expand Down

0 comments on commit 8624907

Please sign in to comment.