Пример #1
0
 function testHeaders()
 {
     $files = array('/unit_tests/_files/HTTP/standard.css');
     $options = array();
     $this->loadConfig();
     $result = Scaffold::parse($files, $this->config, $options, true);
     $this->assertNotNull($result['headers']['Expires']);
     $this->assertNotNull($result['headers']['Cache-Control']);
     $this->assertNotNull($result['headers']['Content-Type']);
     $this->assertNotNull($result['headers']['Last-Modified']);
     $this->assertNotNull($result['headers']['Content-Length']);
     $this->assertNotNull($result['headers']['ETag']);
     // Make sure the content length is set
     $this->assertNotEqual(strlen($result['headers']['Content-Length']), 0);
 }
Пример #2
0
    /**
     * Whether to output the CSS, or return the result of Scaffold
     */
    $display = true;
    /**
     * Set a base directory
     */
    if (isset($_GET['d'])) {
        foreach ($files as $key => $file) {
            $files[$key] = Scaffold_Utils::join_path($_GET['d'], $file);
        }
    }
    /**
     * Parse and join an array of files
     */
    $result = Scaffold::parse($files, $config, $options, $display);
    if ($display === false) {
        stop($result);
    }
}
/**
 * Prints out the value and exits.
 *
 * @author Anthony Short
 * @param $var
 */
function stop($var = '')
{
    if ($var == '') {
        $var = 'Hammer time! Line ' . __LINE__;
    }
Пример #3
0
 function testErrors()
 {
     $this->loadConfig();
     $this->config['display_errors'] = false;
     $this->config['in_production'] = false;
     $this->setupCore();
     $options = array();
     // Via a url
     $files = array('http://scaffold/unit_tests/_files/Misc/general.css');
     $result = Scaffold::parse($files, $this->config, $options, true);
     $this->assertTrue($result['error']);
 }