From dc0c08aa58d19c252d71df3a667965b830ada8b9 Mon Sep 17 00:00:00 2001 From: meus Date: Sun, 2 Sep 2007 22:34:02 +0000 Subject: [PATCH] fixing to adhere to coding standards --- tests/Test.php | 6 +++--- tests/run.php | 54 +++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/Test.php b/tests/Test.php index 46878a5d0..64ab58602 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -20,14 +20,14 @@ class GroupTest extends UnitTestCase } public function shouldBeRun($testCase, $filter){ - if( ! is_array($filter)){ + if( ! is_array($filter)) { return true; } - foreach($filter as $subFilter){ + foreach($filter as $subFilter) { $name = strtolower(get_class($testCase)); $pos = strpos($name, strtolower($subFilter)); //it can be 0 so we have to use === to see if false - if($pos === false){ + if ($pos === false) { return false; } } diff --git a/tests/run.php b/tests/run.php index 497c3befe..039307e36 100644 --- a/tests/run.php +++ b/tests/run.php @@ -3,11 +3,11 @@ ini_set('max_execution_time', 900); function parseOptions($array) { - $currentName=""; + $currentName=''; $options=array(); foreach($array as $name) { - if(strpos($name,"-")===0) { - $name=str_replace("-","",$name); + if(strpos($name,'-')===0) { + $name=str_replace('-','',$name); $currentName=$name; if( ! isset($options[$currentName])) { $options[$currentName]=array(); @@ -415,39 +415,39 @@ class MyReporter extends HtmlReporter { public function paintFooter() { - print "
";
+        print '
';
         foreach ($this->_test->getMessages() as $message) {
-            print $message . "\n";
+            print $message . '\n';
         }
-        print "
"; - $colour = ($this->_test->getFailCount() > 0 ? "red" : "green"); - print "
"; + print '
'; + $colour = ($this->_test->getFailCount() > 0 ? 'red' : 'green'); + print '
'; print $this->_test->getTestCaseCount() . ' test cases'; - print " test cases complete:\n"; - print "" . $this->_test->getPassCount() . " passes and "; - print "" . $this->_test->getFailCount() . " fails."; - print "
\n"; + print ' test cases complete:\n'; + print '' . $this->_test->getPassCount() . ' passes and '; + print '' . $this->_test->getFailCount() . ' fails.'; + print ''; } } ?> addTestCase(new $group); @@ -459,12 +459,12 @@ if( isset($options["group"])) { } else { $testGroup = $test; } -$filter = ""; -if(isset($options["filter"])){ - $filter = $options["filter"]; +$filter = ''; +if (isset($options['filter'])) { + $filter = $options['filter']; } -if (isset($options["help"])) { +if (isset($options['help'])) { echo "Doctrine test runner help\n"; echo "===========================\n"; echo " To run all tests simply run this script without arguments. \n"; @@ -476,13 +476,13 @@ if (isset($options["help"])) { die(); } -if (isset($options["coverage"])) { +if (isset($options['coverage'])) { xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); $testGroup->run($reporter, $filter); - $result["path"] = Doctrine::getPath() . DIRECTORY_SEPARATOR; - $result["coverage"] = xdebug_get_code_coverage(); + $result['path'] = Doctrine::getPath() . DIRECTORY_SEPARATOR; + $result['coverage'] = xdebug_get_code_coverage(); xdebug_stop_code_coverage(); - file_put_contents("coverage.txt", serialize($result)); + file_put_contents('coverage.txt', serialize($result)); } else { $testGroup->run($reporter, $filter); }