protected function setUp() { parent::setUp(); $this->request = ServiceLocator::getInstance()->getService('AccountRequest'); $secretId = $this->request->getConfig('secretId'); $secretKey = $this->request->getConfig('secretKey'); if (empty($secretId) || empty($secretKey)) { $this->markTestSkipped('secretId or secretKey is not set in config file, test will skipped'); } }
public function testBuildSignaturePOSTWithFile() { $param = array('SecretId' => $this->request->getConfig('secretId'), 'Nonce' => 345122, 'Region' => 'gz', 'Timestamp' => 1408704141, 'Action' => 'DescribeInstances', 'Filepath' => $this->request->curl_file_create('/tmp/test1.txt')); $sig = $this->request->buildSignature($param, 'POST'); $this->assertEquals('qiEVyAdhwHvQFCCpU5dDef3S8PA=', $sig); }