Skip to content

Commit 4289c4c

Browse files
committed
Add @media query test
1 parent 0f8da94 commit 4289c4c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Sabberworm\CSS\CSSList;
4+
5+
use Sabberworm\CSS\Parser;
6+
7+
class AtRuleBlockListTest extends \PHPUnit_Framework_TestCase {
8+
9+
public function testMediaQueries() {
10+
$sCss = '@media(min-width: 768px){.class{color:red}}';
11+
$oParser = new Parser($sCss);
12+
$oDoc = $oParser->parse();
13+
$aContents = $oDoc->getContents();
14+
$oMediaQuery = $aContents[0];
15+
$this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
16+
$this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
17+
18+
$sCss = '@media (min-width: 768px) {.class{color:red}}';
19+
$oParser = new Parser($sCss);
20+
$oDoc = $oParser->parse();
21+
$aContents = $oDoc->getContents();
22+
$oMediaQuery = $aContents[0];
23+
$this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
24+
$this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
25+
}
26+
27+
}

0 commit comments

Comments
 (0)