Passed
Pull Request — master (#105)
by
unknown
02:51
created

NfcTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testNfc() 0 22 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
    /**
12
     * @return void
13
     */
14
    public function testNfc()
15
    {
16
        $nfc = new Nfc('message', 'encryptionPublicKey', true);
17
18
        $this->assertEquals('message', $nfc->getMessage());
19
        $this->assertEquals('encryptionPublicKey', $nfc->getEncryptionPublicKey());
20
        $this->assertEquals(true, $nfc->getRequiresAuthentication());
21
22
        $nfc
23
            ->setMessage('hello')
24
            ->setEncryptionPublicKey('publicKey')
25
            ->setRequiresAuthentication(false)
26
        ;
27
28
        $this->assertEquals('hello', $nfc->getMessage());
29
        $this->assertEquals('publicKey', $nfc->getEncryptionPublicKey());
30
        $this->assertEquals(false, $nfc->getRequiresAuthentication());
31
32
        $array = $nfc->toArray();
33
        $this->assertArrayHasKey('message', $array);
34
        $this->assertArrayHasKey('encryptionPublicKey', $array);
35
        $this->assertArrayHasKey('requiresAuthentication', $array);
36
    }
37
}