Passed
Push — master ( a94b97...2fde7e )
by Razvan
03:25
created

NfcTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 15
c 1
b 0
f 1
dl 0
loc 25
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testNfc() 0 20 1
1
<?php
2
3
namespace Passbook\Tests\Pass;
4
5
use Passbook\Pass\Nfc;
6
use PHPUnit\Framework\TestCase;
7
8
class NfcTest extends TestCase
9
{
10
    /**
11
     * @return void
12
     */
13
    public function testNfc()
14
    {
15
        $nfc = new Nfc('message', 'encryptionPublicKey', true);
16
17
        $this->assertEquals('message', $nfc->getMessage());
18
        $this->assertEquals('encryptionPublicKey', $nfc->getEncryptionPublicKey());
19
        $this->assertEquals(true, $nfc->getRequiresAuthentication());
20
21
        $nfc->setMessage('hello')
22
            ->setEncryptionPublicKey('publicKey')
23
            ->setRequiresAuthentication(false);
24
25
        $this->assertEquals('hello', $nfc->getMessage());
26
        $this->assertEquals('publicKey', $nfc->getEncryptionPublicKey());
27
        $this->assertEquals(false, $nfc->getRequiresAuthentication());
28
29
        $array = $nfc->toArray();
30
        $this->assertArrayHasKey('message', $array);
31
        $this->assertArrayHasKey('encryptionPublicKey', $array);
32
        $this->assertArrayHasKey('requiresAuthentication', $array);
33
    }
34
}
35