Dropped asset minification
Been moving away from using this functionality in favor of either Grunt or Gulp. Dropped functionality for minification of CSS and JS but left the dynamic reference logic intact. This will be moved to the HTML class eventually and expanded to support the generation of the HTML tags as well as injecting the URI with a timestamp.
This commit is contained in:
parent
c88d469e18
commit
93ee7356b2
4 changed files with 3 additions and 425 deletions
|
@ -116,121 +116,5 @@ JS;
|
|||
$this->dynamic->reference('/images/image.png?foo=bar'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Filename must have an extension (e.g. /path/to/file.css)
|
||||
*/
|
||||
public function testCSSMissingExtension()
|
||||
{
|
||||
$this->dynamic->css('/css/invalid');
|
||||
}
|
||||
|
||||
public function testCSSWithoutMinify()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = false;
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.\d{10}\.css$/', $this->dynamic->css('/css/stylesheet.css'));
|
||||
}
|
||||
|
||||
public function testCSSWithoutMinifyFileMinifiedFileExists()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = false;
|
||||
|
||||
touch('/tmp/pickles-fs/public/css/stylesheet.min.css');
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.min\.\d{10}\.css$/', $this->dynamic->css('/css/stylesheet.css'));
|
||||
|
||||
unlink('/tmp/pickles-fs/public/css/stylesheet.min.css');
|
||||
}
|
||||
|
||||
public function testCSSWithMinify()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = true;
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.min\.\d{10}\.css$/', $this->dynamic->css('/css/stylesheet.css'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Supplied reference does not exist
|
||||
*/
|
||||
public function testCSSReferenceDoesNotExist()
|
||||
{
|
||||
$this->dynamic->css('/css/missing.css');
|
||||
}
|
||||
|
||||
public function testLESSWithoutMinify()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = false;
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.\d{10}\.less$/', $this->dynamic->css('/css/stylesheet.less'));
|
||||
}
|
||||
|
||||
public function testLESSWithMinify()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = true;
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.min\.\d{10}\.css$/', $this->dynamic->css('/css/stylesheet.less'));
|
||||
}
|
||||
|
||||
public function testSCSSWithoutMinify()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = false;
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.\d{10}\.scss$/', $this->dynamic->css('/css/stylesheet.scss'));
|
||||
}
|
||||
|
||||
public function testSCSSWithMinify()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = true;
|
||||
|
||||
$this->assertRegExp('/^\/css\/stylesheet\.min\.\d{10}\.css$/', $this->dynamic->css('/css/stylesheet.scss'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Filename must have an extension (e.g. /path/to/file.js)
|
||||
*/
|
||||
public function testJSMissingExtension()
|
||||
{
|
||||
$this->dynamic->js('/js/invalid');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Supplied reference does not exist
|
||||
*/
|
||||
public function testJSReferenceDoesNotExist()
|
||||
{
|
||||
$this->dynamic->js('/js/missing.js');
|
||||
}
|
||||
|
||||
public function testJS()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = true;
|
||||
|
||||
$this->assertRegExp('/^\/js\/script\.min\.\d{10}\.js$/', $this->dynamic->js('/js/script.js'));
|
||||
}
|
||||
|
||||
public function testJSWithoutMinifyFileMinifiedFileExists()
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$config->data['pickles']['minify'] = false;
|
||||
|
||||
touch('/tmp/pickles-fs/public/js/script.min.css');
|
||||
|
||||
$this->assertRegExp('/^\/js\/script\.min\.\d{10}\.js$/', $this->dynamic->js('/js/script.js'));
|
||||
|
||||
unlink('/tmp/pickles-fs/public/js/script.min.css');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue