-
Notifications
You must be signed in to change notification settings - Fork 952
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #505 - value must not be empty error when using dynamodb storage.
Adding test for dynamodb storage. Default scope should be null when none is set in the database. Removing immediate return true in dynamodb test.
- Loading branch information
jun
authored and
jun
committed
Mar 4, 2015
1 parent
5ebe653
commit 0786a36
Showing
5 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace OAuth2\Storage; | ||
|
||
class DynamoDBTest extends BaseTest | ||
{ | ||
public function testGetDefaultScope() | ||
{ | ||
$client = $this->getMockBuilder('\Aws\DynamoDb\DynamoDbClient') | ||
->disableOriginalConstructor() | ||
->setMethods(array('query')) | ||
->getMock(); | ||
|
||
$return = $this->getMockBuilder('\Guzzle\Service\Resource\Model') | ||
->setMethods(array('count', 'toArray')) | ||
->getMock(); | ||
|
||
$data = array( | ||
'Items' => array(), | ||
'Count' => 0, | ||
'ScannedCount'=> 0 | ||
); | ||
|
||
$return->expects($this->once()) | ||
->method('count') | ||
->will($this->returnValue(count($data))); | ||
|
||
$return->expects($this->once()) | ||
->method('toArray') | ||
->will($this->returnValue($data)); | ||
|
||
|
||
// should return null default scope if none is set in database | ||
$client->expects($this->once()) | ||
->method('query') | ||
->will($this->returnValue($return)); | ||
|
||
$storage = new DynamoDB($client); | ||
$this->assertNull($storage->getDefaultScope()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters