Update UT
This commit is contained in:
@@ -49,7 +49,7 @@ class VkontakteTest extends \PHPUnit_Framework_TestCase
|
||||
public function testGetAccessToken()
|
||||
{
|
||||
$response = m::mock('Guzzle\Http\Message\Response');
|
||||
$response->shouldReceive('getBody')->times(1)->andReturn('{"access_token": "mock_access_token", "expires": 3600, "refresh_token": "mock_refresh_token", "uid": 1}');
|
||||
$response->shouldReceive('getBody')->times(1)->andReturn('{"access_token": "mock_access_token", "expires": 3600, "refresh_token": "mock_refresh_token", "uid": 1, "email": "mock_email"}');
|
||||
|
||||
$client = m::mock('Guzzle\Service\Client');
|
||||
$client->shouldReceive('setBaseUrl')->times(1);
|
||||
@@ -63,6 +63,7 @@ class VkontakteTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertGreaterThanOrEqual(time(), $token->expires);
|
||||
$this->assertEquals('mock_refresh_token', $token->refreshToken);
|
||||
$this->assertEquals('1', $token->uid);
|
||||
$this->assertEquals('mock_email', $token->email);
|
||||
}
|
||||
|
||||
public function testScopes()
|
||||
@@ -73,10 +74,10 @@ class VkontakteTest extends \PHPUnit_Framework_TestCase
|
||||
public function testUserData()
|
||||
{
|
||||
$postResponse = m::mock('Guzzle\Http\Message\Response');
|
||||
$postResponse->shouldReceive('getBody')->times(1)->andReturn('{"access_token": "mock_access_token", "expires": 3600, "refresh_token": "mock_refresh_token", "uid": 1}');
|
||||
$postResponse->shouldReceive('getBody')->times(1)->andReturn('{"access_token": "mock_access_token", "expires": 3600, "refresh_token": "mock_refresh_token", "uid": 1, "email": "mock_email"}');
|
||||
|
||||
$getResponse = m::mock('Guzzle\Http\Message\Response');
|
||||
$getResponse->shouldReceive('getBody')->times(4)->andReturn('{"response": [{"uid": 12345, "nickname": "mock_nickname", "screen_name": "mock_name", "first_name": "mock_first_name", "last_name": "mock_last_name", "email": "mock_email", "country": "UK", "status": "mock_status", "photo_200_orig": "mock_image_url"}]}');
|
||||
$getResponse->shouldReceive('getBody')->times(4)->andReturn('{"response": [{"uid": 12345, "nickname": "mock_nickname", "screen_name": "mock_name", "first_name": "mock_first_name", "last_name": "mock_last_name", "country": "UK", "status": "mock_status", "photo_200_orig": "mock_image_url"}]}');
|
||||
|
||||
$client = m::mock('Guzzle\Service\Client');
|
||||
$client->shouldReceive('setBaseUrl')->times(5);
|
||||
|
||||
Reference in New Issue
Block a user