PaymentTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 16
c 2
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateAndSetPayment() 0 18 1
1
<?php
2
3
namespace Tests\Classes;
4
5
use PHPUnit\Framework\TestCase;
6
7
class PaymentTest extends TestCase
8
{
9
    public function testCreateAndSetPayment()
10
    {
11
        $payment = new \Ipag\Classes\Payment();
12
        $payment
13
            ->setMethod(\Ipag\Classes\Enum\Method::VISA)
14
            ->setSoftDescriptor('EMPRESA')
15
            ->setPixExpiresIn(60)
16
            ->setInstructions('Instrução 1')
17
            ->setInstructions('Instrução 2')
18
            ->setInstructions('Instrução 3')
19
            ->setInstructions('Instrução 4')
20
            ->setCreditCard(new \Ipag\Classes\CreditCard());
21
22
        $this->assertEquals(\Ipag\Classes\Enum\Method::VISA, $payment->getMethod());
23
        $this->assertEquals('EMPRESA', $payment->getSoftDescriptor());
24
        $this->assertEquals(3, count($payment->getInstructions()));
25
        $this->assertEquals(60, $payment->getPixExpiresIn());
26
        $this->assertInstanceOf(\Ipag\Classes\CreditCard::class, $payment->getCreditCard());
27
    }
28
}
29