Passed
Push — master ( 93ae1f...c8123d )
by TQ
04:05
created

SignatureTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 6
Bugs 1 Features 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 6
b 1
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A testGetBodySignature() 0 4 1
1
<?php
2
namespace Upyun\Tests;
3
4
use Upyun\Signature;
5
use Upyun\Config;
6
use PHPUnit\Framework\TestCase;
7
8
class SignatureTest extends TestCase
9
{
10
11
    /**
12
     * @var Config;
13
     */
14
    public $config;
15
16
    public function setUp(): void
17
    {
18
        $this->config = new Config('bucket', 'operator', 'password');
19
    }
20
21
    public function testGetBodySignature()
22
    {
23
        $sign = Signature::getBodySignature($this->config, 'POST', '/bucket');
24
        $this->assertEquals($sign, 'UPYUN operator:Xx3G6+DAvUyCL2Y2npSW/giTFI8=');
25
    }
26
}
27