Completed
Push — master ( 51b9ae...79147b )
by Craig
10:12
created

PageAssetApiTest::testException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
/*
4
 * This file is part of the Zikula package.
5
 *
6
 * Copyright Zikula Foundation - http://zikula.org/
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zikula\ThemeModule\Tests\Api;
13
14
use Zikula\ThemeModule\Api\PageAssetApi;
15
use Zikula\ThemeModule\Engine\AssetBag;
16
17
class PageAssetApiTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * @var AssetBag
21
     */
22
    private $stylesheets;
23
24
    /**
25
     * @var PageAssetApi
26
     */
27
    private $api;
28
29
    public function setUp()
30
    {
31
        $this->stylesheets = new AssetBag();
32
        $this->api = new PageAssetApi($this->stylesheets, new AssetBag(), new AssetBag(), new AssetBag());
33
    }
34
35
    public function testAdd()
36
    {
37
        $this->assertEmpty($this->stylesheets);
38
        $this->api->add('stylesheet', '/style.css');
39
        $this->assertCount(1, $this->stylesheets);
40
    }
41
42
    /**
43
     * @expectedException \InvalidArgumentException
44
     * @dataProvider exceptionDataProvider
45
     */
46
    public function testException($type, $value)
47
    {
48
        $this->api->add($type, $value);
49
    }
50
51 View Code Duplication
    public function exceptionDataProvider()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
52
    {
53
        return [
54
            ['foo', 'bar'],
55
            ['', 'bar'],
56
            ['foo', ''],
57
        ];
58
    }
59
}
60