PaymentTest::testCreateAndSetPayment()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
c 2
b 0
f 0
dl 0
loc 18
rs 9.7666
cc 1
nc 1
nop 0
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