TokensTraitTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 4
Bugs 1 Features 0
Metric Value
eloc 12
c 4
b 1
f 0
dl 0
loc 26
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_relations() 0 10 1
A test_getTable() 0 5 1
A test_getController() 0 5 1
1
<?php
2
3
namespace ByTIC\Payments\Tests\Models\Tokens;
4
5
use ByTIC\Payments\Models\Tokens\Tokens;
6
use ByTIC\Payments\Tests\AbstractTestCase;
7
8
/**
9
 * Class TransactionsTraitTest
10
 * @package ByTIC\Payments\Tests\Models\Transactions
11
 */
12
class TokensTraitTest extends AbstractTestCase
13
{
14
    public function test_relations()
15
    {
16
        $this->initUtilityModel('purchases');
17
        $this->initUtilityModel('transactions');
18
        $this->initUtilityModel('methods');
19
        $repository = new Tokens();
20
21
        self::assertTrue($repository->hasRelation('Transactions'));
22
        self::assertTrue($repository->hasRelation('Customer'));
23
        self::assertTrue($repository->hasRelation('PaymentMethod'));
24
    }
25
26
    public function test_getTable()
27
    {
28
        $repository = new Tokens();
29
30
        self::assertSame('payments-tokens', $repository->getTable());
31
    }
32
33
    public function test_getController()
34
    {
35
        $repository = new Tokens();
36
37
        self::assertSame('payments-tokens', $repository->getController());
38
    }
39
}
40