Completed
Pull Request — develop (#14)
by Rimas
03:51
created

SealTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 86.67 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 26
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSign() 15 15 1
A getDocumentParams() 11 11 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
namespace Isign\Tests\Integration;
3
4
use Isign\ResultInterface;
5
use Isign\Document;
6
7
class SealTest extends TestCase
8
{
9 View Code Duplication
    public function testSign()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
    {
11
        /** @var Isign\Document\SealResult $result */
12
        $result = $this->client->get(new Document\Seal(
13
            'pdf',
14
            $this->getDocumentParams(),
15
            false
16
        ));
17
18
        $this->assertSame(ResultInterface::STATUS_OK, $result->getStatus());
19
        $this->assertSame('Signature1', $result->getSignatureId());
20
        $this->assertNotEmpty($result->getFile());
21
22
        return $result;
23
    }
24
25 View Code Duplication
    private function getDocumentParams()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        return [
28
            'contact' => 'Ponas Testuotojas',
29
            'reason' => 'Elektroninis spaudas',
30
            'location' => 'Vilnius',
31
            'files' => [
32
               __DIR__ . '/../data/document.pdf',
33
            ]
34
        ];
35
    }
36
}
37