-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.php
78 lines (65 loc) · 1.19 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
include 'convert.php';
include 'test_data.php';
include 'expect.php';
try {
$converter = new CssToSassConverter();
$expect = new Expect();
$expect->equal(
$converter->getStatementBlocks($testData),
array(
'#my_element h1 {
font-weight: bold;
}',
'#my_element ul.test {
list-style-type: none
}',
'#my_element ul.test {
color: white;
background: black;
}',
'#my_element ul.test .list-item {
text-decoration: none;
color: #737373;
}',
'#my_element ul.test .list-item:last-child {
font-weight: bold;
}'
)
);
$expect->equal(
$converter->getSelectors($testData),
array(
'#my_element' => array(
'h1' => array(),
'ul.test' => array(
'.list-item' => array(),
'.list-item:last-child' => array()
)
)
)
);
/*
Version 2.0 for this
*/
// $expect->equal(
// $converter->getSelectors($testData),
// array(
// '#my_element' => array(
// 'h1' => array(),
// 'ul.test' => array(
// '.list-item' => array(
// '&:last-child' => array()
// )
// )
// )
// )
// );
$expect->equal(
$converter->convert($testData),
$expectedOutput
);
echo "\nAll tests passed. \n";
} catch (Exception $e) {
echo $e->getMessage() . "\n\n";
}