Completed
Push — master ( 28322c...d75af5 )
by Michal
02:18
created

ILess_Test_Issues_065Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
cbo 2
dl 0
loc 39
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIssuesWithMathOffAsDefault() 0 17 1
A testIssue() 0 18 1
1
<?php
2
3
/*
4
 * This file is part of the ILess
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
use ILess\Parser;
11
12
/**
13
 * Issue #65 test.
14
 */
15
class ILess_Test_Issues_065Test extends Test_TestCase
16
{
17
    public function testIssuesWithMathOffAsDefault()
18
    {
19
        $parser = new Parser();
20
21
        $parser->parseString(
22
            'body { total-width: (1 * 6em * 12) + (2em * 12); }'
23
        );
24
25
        $css = $parser->getCSS();
26
27
        $expected = 'body {
28
  total-width: 96em;
29
}
30
';
31
32
        $this->assertEquals($expected, $css);
33
    }
34
35
    public function testIssue()
36
    {
37
        $parser = new Parser([
38
            'strictMath' => true,
39
        ]);
40
41
        $parser->parseString(
42
            'body { total-width: (1 * 6em * 12) + (2em * 12); }'
43
        );
44
45
        $css = $parser->getCSS();
46
47
        $expected = 'body {
48
  total-width: (1 * 6em * 12) + (2em * 12);
49
}
50
';
51
        $this->assertEquals($expected, $css);
52
    }
53
}
54