mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Cleanup, removing redundant returns
This commit is contained in:
parent
657606e8c8
commit
77e30d4524
@ -118,9 +118,8 @@ class SSViewerTest extends SapphireTest {
|
|||||||
// first make sure that our test js file causes an exception to be thrown
|
// first make sure that our test js file causes an exception to be thrown
|
||||||
try{
|
try{
|
||||||
$content = JSMin::minify($content);
|
$content = JSMin::minify($content);
|
||||||
$this->fail('JSMin did not throw exception on minify bad file: ');
|
|
||||||
Requirements::set_backend($oldBackend);
|
Requirements::set_backend($oldBackend);
|
||||||
return;
|
$this->fail('JSMin did not throw exception on minify bad file: ');
|
||||||
}catch(Exception $e){
|
}catch(Exception $e){
|
||||||
// exception thrown... good
|
// exception thrown... good
|
||||||
}
|
}
|
||||||
@ -131,21 +130,18 @@ class SSViewerTest extends SapphireTest {
|
|||||||
Requirements::process_combined_files();
|
Requirements::process_combined_files();
|
||||||
}catch(PHPUnit_Framework_Error_Warning $e){
|
}catch(PHPUnit_Framework_Error_Warning $e){
|
||||||
if(strstr($e->getMessage(), 'Failed to minify') === false){
|
if(strstr($e->getMessage(), 'Failed to minify') === false){
|
||||||
$this->fail('Requirements::process_combined_files raised a warning, which is good, but this is not the expected warning ("Failed to minify..."): '.$e);
|
|
||||||
Requirements::set_backend($oldBackend);
|
Requirements::set_backend($oldBackend);
|
||||||
return;
|
$this->fail('Requirements::process_combined_files raised a warning, which is good, but this is not the expected warning ("Failed to minify..."): '.$e);
|
||||||
}
|
}
|
||||||
}catch(Exception $e){
|
}catch(Exception $e){
|
||||||
$this->fail('Requirements::process_combined_files did not catch exception caused by minifying bad js file: '.$e);
|
|
||||||
Requirements::set_backend($oldBackend);
|
Requirements::set_backend($oldBackend);
|
||||||
return;
|
$this->fail('Requirements::process_combined_files did not catch exception caused by minifying bad js file: '.$e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// and make sure the combined content matches the input content, i.e. no loss of functionality
|
// and make sure the combined content matches the input content, i.e. no loss of functionality
|
||||||
if(!file_exists($combinedTestFilePath)){
|
if(!file_exists($combinedTestFilePath)){
|
||||||
$this->fail('No combined file was created at expected path: '.$combinedTestFilePath);
|
|
||||||
Requirements::set_backend($oldBackend);
|
Requirements::set_backend($oldBackend);
|
||||||
return;
|
$this->fail('No combined file was created at expected path: '.$combinedTestFilePath);
|
||||||
}
|
}
|
||||||
$combinedTestFileContents = file_get_contents($combinedTestFilePath);
|
$combinedTestFileContents = file_get_contents($combinedTestFilePath);
|
||||||
$this->assertContains($jsFileContents, $combinedTestFileContents);
|
$this->assertContains($jsFileContents, $combinedTestFileContents);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user