Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tested cache dependencies
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
class ScssSourceTest extends TestCase | ||
{ | ||
public function setUp() | ||
{ | ||
$this->realDocRoot = $_SERVER['DOCUMENT_ROOT']; | ||
$_SERVER['DOCUMENT_ROOT'] = self::$document_root; | ||
} | ||
|
||
/** | ||
* @link https://github.com/mrclay/minify/issues/500 | ||
*/ | ||
public function testTimestamp() | ||
{ | ||
$baseDir = self::$test_files; | ||
|
||
$mainLess = "$baseDir/main.scss"; | ||
$includedLess = "$baseDir/_included.scss"; | ||
|
||
// touch timestamp with 1s difference | ||
touch($mainLess); | ||
sleep(1); | ||
touch($includedLess); | ||
|
||
$mtime1 = filemtime($mainLess); | ||
var_dump($mtime1); | ||
$mtime2 = filemtime($includedLess); | ||
var_dump($mtime2); | ||
|
||
$max = max($mtime1, $mtime2); | ||
|
||
$options = array( | ||
'groupsConfigFile' => "$baseDir/htmlHelper_groupsConfig.php", | ||
); | ||
$res = Minify_HTML_Helper::getUri('scss', $options); | ||
|
||
$this->assertEquals("/min/g=scss&{$max}", $res); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* lesstest2.scss */ | ||
|
||
|
||
a.included { | ||
color: $primary-color; | ||
font-size: 13px; | ||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,8 @@ | |
'less' => array( | ||
'//_test_files/main.less', | ||
), | ||
|
||
'scss' => array( | ||
'//_test_files/main.scss', | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*! preserving comment */ | ||
|
||
// Variable | ||
$primary-color: hotpink; | ||
|
||
// Mixin | ||
@mixin border-radius($radius) { | ||
-webkit-border-radius: $radius; | ||
-moz-border-radius: $radius; | ||
border-radius: $radius; | ||
} | ||
|
||
.my-element { | ||
color: $primary-color; | ||
width: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
.my-other-element { | ||
@include border-radius(6px); | ||
} | ||
|
||
/* import include -> */ | ||
@import "_included"; | ||
/* <- import included */ | ||
|
||
/* | ||
a normal comment. | ||
*/ |