mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-18 18:59:56 +09:00
Move all composer files inside the common directory
- 2022년 3월 개발팀 결정사항 적용 - 모듈 등 서드파티 자료 개발시 composer를 사용하면 상위 경로에 있는 코어의 composer.json을 수정하고, 코어의 vendor 디렉토리를 건드리는 것이 기본값임 - 이를 방지하기 위해 코어의 composer.json과 vendor를 common 디렉토리 안으로 이동하여, 모듈 경로에서 상위 폴더로 인식하지 않도록 함
This commit is contained in:
parent
7b912d21fc
commit
5fff6b6eab
1478 changed files with 2 additions and 2 deletions
90
vendor/leafo/lessphp/tests/InputTest.php
vendored
90
vendor/leafo/lessphp/tests/InputTest.php
vendored
|
|
@ -1,90 +0,0 @@
|
|||
<?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);
|
||||
}
|
||||
|
||||
public static 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");
|
||||
}
|
||||
|
||||
public static 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue