Completed
Push — develop ( d0e808...84afed )
by
unknown
17s queued 14s
created

AddSignerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 16
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testSuccess() 0 22 1
1
<?php
2
namespace Dokobit\Gateway\Tests\Integration\Signing;
3
4
use Dokobit\Gateway\Query\Signing\AddSigner;
5
use Dokobit\Gateway\Result\Signing\AddSignerResult;
6
use Dokobit\Gateway\Tests\Integration\TestCase;
7
8
class AddSignerTest extends TestCase
9
{
10
    protected function setUp(): void
11
    {
12
        parent::setUp();
13
        $this->createSigning();
14
    }
15
16
    public function testSuccess()
17
    {
18
        /** @var AddSignerResult $result */
19
        $result = $this->client->get(new AddSigner(
20
            $this->signingToken,
21
            [
22
                [
23
                    'id' => self::SIGNER2_ID,
24
                    'name' => 'Fleur',
25
                    'surname' => 'Boland',
26
                    'signing_purpose' => 'signature',
27
                ],
28
            ]
29
        ));
30
31
        $this->assertSame('ok', $result->getStatus());
32
        $signers = $result->getSigners();
33
        $this->assertNotEmpty($signers);
34
        $this->assertArrayHasKey(self::SIGNER1_ID, $signers);
35
        $this->assertArrayHasKey(self::SIGNER2_ID, $signers);
36
        $this->assertNotEmpty($signers[self::SIGNER1_ID]);
37
        $this->assertNotEmpty($signers[self::SIGNER2_ID]);
38
    }
39
}
40