This repository has been archived by the owner on Oct 16, 2019. It is now read-only.
/
V1Test.php
64 lines (53 loc) · 1.72 KB
/
V1Test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Service
*/
namespace ZendTest\Service\Amazon\Authentication;
use Zend\Service\Amazon\Authentication;
use Zend\Service\Amazon\Authentication\Exception;
/**
* Amazon V1 authentication test case
*
* @category Zend
* @package Zend_Service_Amazon_Authentication
* @subpackage UnitTests
*/
class V1Test extends \PHPUnit_Framework_TestCase
{
/**
* @var Authentication\V1
*/
private $_amazon;
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
$this->_amazon = new Authentication\V1('0PN5J17HBGZHT7JJ3X82', 'uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o', '2007-12-01');
}
/**
* Cleans up the environment after running a test.
*/
protected function tearDown()
{
$this->_amazon = null;
}
/**
* Tests Authentication\V1::generateSignature()
*/
public function testGenerateDevPaySignature()
{
$url = "https://ls.amazonaws.com/";
$params = array();
$params['Action'] = "ActivateHostedProduct";
$params['Timestamp'] = "2009-11-11T13:52:38Z";
$ret = $this->_amazon->generateSignature($url, $params);
$this->assertEquals('31Q2YlgABM5X3GkYQpGErcL10Xc=', $params['Signature']);
$this->assertEquals("ActionActivateHostedProductAWSAccessKeyId0PN5J17HBGZHT7JJ3X82SignatureVersion1Timestamp2009-11-11T13:52:38ZVersion2007-12-01", $ret);
}
}