HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/selfanalyse/dompdf/lib/php-css-parser/tests/Sabberworm/CSS/CSSList/AtRuleBlockListTest.php
<?php

namespace Sabberworm\CSS\CSSList;

use Sabberworm\CSS\Parser;

class AtRuleBlockListTest extends \PHPUnit_Framework_TestCase {

	public function testMediaQueries() {
		$sCss = '@media(min-width: 768px){.class{color:red}}';
		$oParser = new Parser($sCss);
		$oDoc = $oParser->parse();
		$aContents = $oDoc->getContents();
		$oMediaQuery = $aContents[0];
		$this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
		$this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');

		$sCss = '@media (min-width: 768px) {.class{color:red}}';
		$oParser = new Parser($sCss);
		$oDoc = $oParser->parse();
		$aContents = $oDoc->getContents();
		$oMediaQuery = $aContents[0];
		$this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
		$this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
	}

}