public function testSimpleBuildFromFile() { $mockFileName = __DIR__ . "/mocks/main.less"; $outputFileName = __DIR__ . "/mocks/output"; $outputFileContents = file_get_contents($outputFileName); self::assertEquals($outputFileContents, CssBuilder::buildFile($mockFileName)); }
$toReturn .= $this->minifyCssString($css); } return $toReturn; } private function minifyCssString($string) { if (!is_string($string)) { return ""; } $string = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $string); $string = str_replace(': ', ':', $string); $string = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $string); return $string; } public function getResponse() { return $this->response; } } define('EDUCASK_ROOT', dirname(getcwd())); require_once EDUCASK_ROOT . '/core/classes/Bootstrap.php'; Bootstrap::registerAutoloader(); Bootstrap::initializePlugins(); $cssBuilder = new CssBuilder(); $response = $cssBuilder->getResponse(); http_response_code($response->getResponseCode()); $headers = $response->getHeaders(); foreach ($headers as $header => $value) { header($header . ": " . $value, true); } echo $response->getRawContent();