From 77e30d4524810948db262ca674f431338523a180 Mon Sep 17 00:00:00 2001 From: Igor Nadj Date: Wed, 26 Nov 2014 15:31:07 +1300 Subject: [PATCH] Cleanup, removing redundant returns --- tests/view/SSViewerTest.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/view/SSViewerTest.php b/tests/view/SSViewerTest.php index 6fa92b795..7511af1ca 100644 --- a/tests/view/SSViewerTest.php +++ b/tests/view/SSViewerTest.php @@ -114,13 +114,12 @@ class SSViewerTest extends SapphireTest { $jsFileContents = file_get_contents(BASE_PATH . '/' . $jsFile); Requirements::combine_files('testRequirementsCombine.js', array($jsFile)); require_once('thirdparty/jsmin/jsmin.php'); - + // first make sure that our test js file causes an exception to be thrown try{ $content = JSMin::minify($content); - $this->fail('JSMin did not throw exception on minify bad file: '); Requirements::set_backend($oldBackend); - return; + $this->fail('JSMin did not throw exception on minify bad file: '); }catch(Exception $e){ // exception thrown... good } @@ -131,21 +130,18 @@ class SSViewerTest extends SapphireTest { Requirements::process_combined_files(); }catch(PHPUnit_Framework_Error_Warning $e){ 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); - 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){ - $this->fail('Requirements::process_combined_files did not catch exception caused by minifying bad js file: '.$e); 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 if(!file_exists($combinedTestFilePath)){ - $this->fail('No combined file was created at expected path: '.$combinedTestFilePath); Requirements::set_backend($oldBackend); - return; + $this->fail('No combined file was created at expected path: '.$combinedTestFilePath); } $combinedTestFileContents = file_get_contents($combinedTestFilePath); $this->assertContains($jsFileContents, $combinedTestFileContents);