-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Support child fixtures and enable for lessjs-2.5.3
Refactor the way we run fixtures to also consider child fixtures. We can't simply extend the glob() as-is, because the reason child fixtures exist is to separate input files that excercise non-default Parser options. For example, "compression/" tests the output of the `compress => true` option. * Move array of fixture groups from FixtureTest.php to fixtures.php, so that compare.php can easily re-use it. * Make the cssDir and lessDir explicit instead of automatic, so that we can easily set it to a subdirectory. * Add optional 'options' key for custom Parser options. * Define "strict-units/", and enable in PHPUnit. We pass this! * Define "compression/", and enable in PHPUnit. Add an override because our output is slightly less optimised than upstream (we output "0.5px" and "0px", instead of the shorter zeroless ".5px" and unitless "0"). To test live and compare against upstream output, run: `test compare.php test/Fixtures/lessjs-2.5.3/css/compression/` * Define "lessjs-2.5.3/include-path/", and disable in PHPUnit. We haven't implemented data-uri() yet. Change-Id: Iade37bae1728202926026289f3bc7acdfd1ab078
- Loading branch information
Showing
4 changed files
with
135 additions
and
51 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
test/Fixtures/lessjs-2.5.3/override/compression/compression.css
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,3 @@ | ||
#colours{color1:#fea;color2:#ffeeaa;color3:rgba(255,238,170,0.1);string:"#fea";/*! but not this type | ||
Note preserved whitespace | ||
*/}dimensions{val:0.1px;val:0em;val:4cm;val:0.2;val:5;angles-must-have-unit:0deg;durations-must-have-unit:0s;length-doesnt-have-unit:0px;width:auto\9}@page{marks:none;@top-left-corner{vertical-align:top}@top-left{vertical-align:top}}.shadow^.dom,body^^.shadow{display:done} |
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
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,51 @@ | ||
<?php | ||
|
||
// Used by phpunit/FixturesTest.php and test/compare.php | ||
|
||
$fixtureDir = __DIR__ . '/Fixtures'; | ||
|
||
return [ | ||
'less.php' => [ | ||
'lessDir' => "$fixtureDir/less.php/less", | ||
'cssDir' => "$fixtureDir/less.php/css", | ||
], | ||
'bug-reports' => [ | ||
'lessDir' => "$fixtureDir/bug-reports/less", | ||
'cssDir' => "$fixtureDir/bug-reports/css", | ||
], | ||
|
||
// Upstream fixtures and parser options are declared | ||
// at https://github.com/less/less.js/blob/v2.5.3/test/index.js#L17 | ||
|
||
'lessjs-2.5.3' => [ | ||
'lessDir' => "$fixtureDir/lessjs-2.5.3/less", | ||
'cssDir' => "$fixtureDir/lessjs-2.5.3/css", | ||
'overrideDir' => "$fixtureDir/lessjs-2.5.3/override", | ||
], | ||
'lessjs-2.5.3/compression' => [ | ||
'lessDir' => "$fixtureDir/lessjs-2.5.3/less/compression", | ||
'cssDir' => "$fixtureDir/lessjs-2.5.3/css/compression", | ||
'overrideDir' => "$fixtureDir/lessjs-2.5.3/override/compression", | ||
'options' => [ | ||
'compress' => true, | ||
], | ||
], | ||
'lessjs-2.5.3/strict-units' => [ | ||
'lessDir' => "$fixtureDir/lessjs-2.5.3/less/strict-units", | ||
'cssDir' => "$fixtureDir/lessjs-2.5.3/css/strict-units", | ||
'options' => [ | ||
'strictUnits' => true, | ||
], | ||
], | ||
'lessjs-2.5.3/include-path' => [ | ||
'lessDir' => "$fixtureDir/lessjs-2.5.3/less/include-path", | ||
'cssDir' => "$fixtureDir/lessjs-2.5.3/css/include-path", | ||
'overrideDir' => "$fixtureDir/lessjs-2.5.3/override/include-path", | ||
'options' => [ | ||
'import_dirs' => [ | ||
"$fixtureDir/lessjs-2.5.3/data" => '', | ||
"$fixtureDir/lessjs-2.5.3/less/import" => '', | ||
], | ||
], | ||
], | ||
]; |
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