PaymentsAssetsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_adminPurchasesSessionsList_empty() 0 9 1
A basePath() 0 3 1
1
<?php
2
3
namespace ByTIC\Payments\Tests\Utility;
4
5
use ByTIC\Payments\Models\Purchases\Purchase;
6
use ByTIC\Payments\Models\PurchaseSessions\PurchaseSessions;
7
use ByTIC\Payments\Tests\AbstractTestCase;
8
use ByTIC\Payments\Utility\PaymentsAssets;
9
use Nip\Records\Locator\ModelLocator;
10
11
/**
12
 * Class PaymentsAssetsTest
13
 * @package ByTIC\Payments\Tests\Utility
14
 */
15
class PaymentsAssetsTest extends AbstractTestCase
16
{
17
    public function basePath()
18
    {
19
        self::assertStringEndsWith('bytic' . DIRECTORY_SEPARATOR . 'payments', PaymentsAssets::basePath());
20
    }
21
22
    public function test_adminPurchasesSessionsList_empty()
23
    {
24
        $purchase = \Mockery::mock(Purchase::class)->makePartial();
25
        $purchase->shouldReceive('getPurchasesSessions')->once()->andReturn([]);
26
27
        ModelLocator::set(PurchaseSessions::class, new PurchaseSessions());
28
29
        $return = PaymentsAssets::adminPurchasesSessionsList($purchase);
30
        self::assertStringContainsString('dnx', $return);
31
    }
32
}
33