vendor/leafo/scssphp/tests/ExceptionTest.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
require_once __DIR__ . "/../scss.inc.php";
class ExceptionTest extends PHPUnit_Framework_TestCase {
public function setUp() {
$this->scss = new scssc();
}
/**
* @param string $scss
* @param string $expectedExceptionMessage
*
* @dataProvider provideScss
*/
public function testThrowError($scss, $expectedExceptionMessage) {
try {
$this->compile($scss);
} catch (Exception $e) {
if (strpos($e->getMessage(), $expectedExceptionMessage) !== false) {
return;
};
}
$this->fail('Expected exception to be raised: ' . $expectedExceptionMessage);
}
/**
* @return array
*/
public function provideScss() {
return array(
array(<<<END_OF_SCSS
.test {
foo : bar;
END_OF_SCSS
,
'unclosed block'
),
array(<<<END_OF_SCSS
.test {
}}
END_OF_SCSS
,
'unexpected }'
),
array(<<<END_OF_SCSS
.test { color: #fff / 0; }
END_OF_SCSS
,
'color: Can\'t divide by zero'
),
array(<<<END_OF_SCSS
.test {
@include foo();
}
END_OF_SCSS
,
'Undefined mixin foo'
),
后面还有 26 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
