HelpersTest::testCssArrayToString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Wa72\HtmlPageDom\Tests;
4
5
use PHPUnit\Framework\TestCase;
6
use Wa72\HtmlPageDom\Helpers;
7
8
class HelpersTest extends TestCase
9
{
10
    public function testCssStringToArray()
11
    {
12
        $this->assertEquals([
13
            'font-size' => '15px',
14
            'font-weight' => 'bold',
15
            'font-color' => 'black'
16
        ], Helpers::cssStringToArray('invalid_css_string;font-size: 15px;font-weight: bold;font-color: black;'));
17
    }
18
19
    public function testCssArrayToString()
20
    {
21
        $this->assertEquals('font-size: 15px;font-weight: bold;font-color: black;', Helpers::cssArrayToString([
22
            'font-size' => '15px',
23
            'font-weight' => 'bold',
24
            'font-color' => 'black'
25
        ]));
26
    }
27
}
28