Completed
Push — master ( 95aedb...06e367 )
by Alexey
15:04
created

ExampleAssetTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRegister() 0 11 1
1
<?php
2
3
namespace tests;
4
5
use dominus77\sweetalert2\assets\ExampleAsset;
6
use yii\web\AssetBundle;
7
8
/**
9
 * Class ExampleAssetTest
10
 * @package tests
11
 */
12
class ExampleAssetTest extends TestCase
13
{
14
    public function testRegister()
15
    {
16
        $view = $this->getView();
17
        $this->assertEmpty($view->assetBundles);
18
        ExampleAsset::register($view);
19
        $this->assertEquals(1, count($view->assetBundles));
20
        $this->assertTrue($view->assetBundles['dominus77\\sweetalert2\\assets\\ExampleAsset'] instanceof AssetBundle);
21
        $content = $view->renderFile('@tests/views/layouts/rawlayout.php');
22
        $this->assertContains('example.css', $content);
23
        $this->assertContains('buttons.css', $content);
24
    }
25
}