Completed
Push — master ( 9f2de6...30d7f3 )
by sabaku
04:09
created

SignatureTest::testGetBodySignature()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
namespace Upyun\Tests;
3
use Upyun\Signature;
4
use Upyun\Config;
5
6
class SignatureTest extends \PHPUnit_Framework_TestCase{
7
8
    /**
9
     * @var Config;
10
     */
11
    public $config;
12
13
    public function setUp() {
14
        $this->config = new Config('bucket', 'operator', 'password');
15
    }
16
17
    public function testGetSignature() {
18
        $sign = Signature::getSignature($this->config, array('a' => 'a', 'b' => 'b'), Signature::SIGN_MULTIPART, '123');
19
        $this->assertEquals($sign , '2aa0afd612df8fab4b3fded36c396234');
0 ignored issues
show
Coding Style introduced by
Space found before comma in function call
Loading history...
20
    }
21
22
    public function testGetBodySignature() {
23
        $sign = Signature::getBodySignature($this->config, 'POST', '/bucket');
24
        $this->assertEquals($sign, 'UPYUN operator:Xx3G6+DAvUyCL2Y2npSW/giTFI8=');
25
    }
26
}
27