Passed
Push — master ( e689f4...c0f464 )
by Gabriel
12:33
created

test_adminPurchasesSessionsList_empty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 9
rs 10
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\AbstractTest;
8
use ByTIC\Payments\Utility\PaymentsAssets;
9
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
10
use Nip\Records\Locator\ModelLocator;
11
12
/**
13
 * Class PaymentsAssetsTest
14
 * @package ByTIC\Payments\Tests\Utility
15
 */
16
class PaymentsAssetsTest extends AbstractTest
17
{
18
    use MockeryPHPUnitIntegration;
19
20
    public function basePath()
21
    {
22
        self::assertStringEndsWith('bytic' . DIRECTORY_SEPARATOR . 'payments', PaymentsAssets::basePath());
23
    }
24
25
    public function test_adminPurchasesSessionsList_empty()
26
    {
27
        $purchase = \Mockery::mock(Purchase::class)->makePartial();
28
        $purchase->shouldReceive('getPurchasesSessions')->once()->andReturn([]);
29
30
        ModelLocator::set(PurchaseSessions::class, PurchaseSessions::instance());
31
32
        $return = PaymentsAssets::adminPurchasesSessionsList($purchase);
33
        self::assertStringContainsString('dnx', $return);
34
    }
35
}
36