setTargetFile() does not need to check for existing file.
This commit is contained in:
parent
c2c96c7079
commit
0ec5686518
2 changed files with 3 additions and 8 deletions
|
@ -186,11 +186,7 @@ class ClosureCompiler
|
||||||
public function setTargetFile($file)
|
public function setTargetFile($file)
|
||||||
{
|
{
|
||||||
$path = $this->config['targetBaseDir'] . $file;
|
$path = $this->config['targetBaseDir'] . $file;
|
||||||
if (file_exists($path)) {
|
$this->config['targetFileName'] = $path;
|
||||||
$this->config['targetFileName'] = $path;
|
|
||||||
} else {
|
|
||||||
throw new CompilerException("The path '{$path}' does not seem to exist.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -208,13 +208,12 @@ class closureCompilerTest extends PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Devize\ClosureCompiler\ClosureCompiler::setTargetFile
|
* @covers Devize\ClosureCompiler\ClosureCompiler::setTargetFile
|
||||||
* @expectedException Devize\ClosureCompiler\CompilerException
|
|
||||||
* @expectedExceptionMessage The path 'test.js' does not seem to exist.
|
|
||||||
*/
|
*/
|
||||||
public function testSetTargetFile1()
|
public function testSetTargetFile1()
|
||||||
{
|
{
|
||||||
$this->object->setTargetFile('test.js');
|
$this->object->setTargetFile('test.js');
|
||||||
|
$result = $this->object->getConfig();
|
||||||
|
$this->assertEquals($result['targetBaseDir'] . 'test.js', $result['targetFileName']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue