@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $manager->configureXml(dirname(__FILE__).'/sqlmap.xml'); |
| 13 | 13 | $this->fail(); |
| 14 | - }catch(TSqlMapConfigurationException $e) |
|
| 14 | + } catch(TSqlMapConfigurationException $e) |
|
| 15 | 15 | { |
| 16 | 16 | $expect = 'Invalid property \'parametrClass\' for class \'TSqlMapStatement\' for tag \'<statement id="findNotVisitedWatchedTopicList"'; |
| 17 | 17 | $this->assertEqual(strpos($e->getMessage(),$expect),0); |
@@ -4,8 +4,9 @@ |
||
| 4 | 4 | { |
| 5 | 5 | public function addRange($accounts) |
| 6 | 6 | { |
| 7 | - foreach($accounts as $account) |
|
| 8 | - $this->add($account); |
|
| 7 | + foreach($accounts as $account) { |
|
| 8 | + $this->add($account); |
|
| 9 | + } |
|
| 9 | 10 | } |
| 10 | 11 | |
| 11 | 12 | public function copyTo(TList $array) |
@@ -38,14 +38,16 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function __destruct() |
| 40 | 40 | { |
| 41 | - if(!is_null($this->mapper)) |
|
| 42 | - $this->mapper->cacheConfiguration(); |
|
| 41 | + if(!is_null($this->mapper)) { |
|
| 42 | + $this->mapper->cacheConfiguration(); |
|
| 43 | + } |
|
| 43 | 44 | } |
| 44 | 45 | |
| 45 | 46 | function getConnection() |
| 46 | 47 | { |
| 47 | - if(is_null($this->connection)) |
|
| 48 | - $this->connection = $this->config->getConnection(); |
|
| 48 | + if(is_null($this->connection)) { |
|
| 49 | + $this->connection = $this->config->getConnection(); |
|
| 50 | + } |
|
| 49 | 51 | $this->connection->setActive(true); |
| 50 | 52 | return $this->connection; |
| 51 | 53 | } |
@@ -112,10 +114,11 @@ discard block |
||
| 112 | 114 | $date = @mktime(8,15,0,2,15,2003); |
| 113 | 115 | |
| 114 | 116 | $this->assertIdentical((int)$order->getID(), 1); |
| 115 | - if($order->getDate() instanceof TDateTime) |
|
| 116 | - $this->assertIdentical($order->getDate()->getTimestamp(), $date); |
|
| 117 | - else |
|
| 118 | - $this->fail(); |
|
| 117 | + if($order->getDate() instanceof TDateTime) { |
|
| 118 | + $this->assertIdentical($order->getDate()->getTimestamp(), $date); |
|
| 119 | + } else { |
|
| 120 | + $this->fail(); |
|
| 121 | + } |
|
| 119 | 122 | $this->assertIdentical($order->getCardType(), 'VISA'); |
| 120 | 123 | $this->assertIdentical($order->getCardNumber(), '999999999999'); |
| 121 | 124 | $this->assertIdentical($order->getCardExpiry(), '05/03'); |
@@ -137,10 +140,11 @@ discard block |
||
| 137 | 140 | $date = @mktime(8,15,0,2,15,2003); |
| 138 | 141 | |
| 139 | 142 | $this->assertIdentical(1, $order["Id"]); |
| 140 | - if($order['Date'] instanceof TDateTime) |
|
| 141 | - $this->assertIdentical($date, $order["Date"]->getTimestamp()); |
|
| 142 | - else |
|
| 143 | - $this->fail(); |
|
| 143 | + if($order['Date'] instanceof TDateTime) { |
|
| 144 | + $this->assertIdentical($date, $order["Date"]->getTimestamp()); |
|
| 145 | + } else { |
|
| 146 | + $this->fail(); |
|
| 147 | + } |
|
| 144 | 148 | $this->assertIdentical("VISA", $order["CardType"]); |
| 145 | 149 | $this->assertIdentical("999999999999", $order["CardNumber"]); |
| 146 | 150 | $this->assertIdentical("05/03", $order["CardExpiry"]); |
@@ -157,19 +161,22 @@ discard block |
||
| 157 | 161 | public function getResult($string) |
| 158 | 162 | { |
| 159 | 163 | $value = intval($string); |
| 160 | - if($value == 100) |
|
| 161 | - return true; |
|
| 162 | - if($value == 200) |
|
| 163 | - return false; |
|
| 164 | + if($value == 100) { |
|
| 165 | + return true; |
|
| 166 | + } |
|
| 167 | + if($value == 200) { |
|
| 168 | + return false; |
|
| 169 | + } |
|
| 164 | 170 | //throw new Exception('unexpected value '.$value); |
| 165 | 171 | } |
| 166 | 172 | |
| 167 | 173 | public function getParameter($parameter) |
| 168 | 174 | { |
| 169 | - if($parameter) |
|
| 170 | - return 100; |
|
| 171 | - else |
|
| 172 | - return 200; |
|
| 175 | + if($parameter) { |
|
| 176 | + return 100; |
|
| 177 | + } else { |
|
| 178 | + return 200; |
|
| 179 | + } |
|
| 173 | 180 | } |
| 174 | 181 | |
| 175 | 182 | public function createNewInstance($data=null) |
@@ -185,19 +192,22 @@ discard block |
||
| 185 | 192 | |
| 186 | 193 | public function getResult($string) |
| 187 | 194 | { |
| 188 | - if($string === self::YES) |
|
| 189 | - return true; |
|
| 190 | - if($string === self::NO) |
|
| 191 | - return false; |
|
| 195 | + if($string === self::YES) { |
|
| 196 | + return true; |
|
| 197 | + } |
|
| 198 | + if($string === self::NO) { |
|
| 199 | + return false; |
|
| 200 | + } |
|
| 192 | 201 | //throw new Exception('unexpected value '.$string); |
| 193 | 202 | } |
| 194 | 203 | |
| 195 | 204 | public function getParameter($parameter) |
| 196 | 205 | { |
| 197 | - if($parameter) |
|
| 198 | - return self::YES; |
|
| 199 | - else |
|
| 200 | - return self::NO; |
|
| 206 | + if($parameter) { |
|
| 207 | + return self::YES; |
|
| 208 | + } else { |
|
| 209 | + return self::NO; |
|
| 210 | + } |
|
| 201 | 211 | } |
| 202 | 212 | |
| 203 | 213 | public function createNewInstance($data=null) |
@@ -221,10 +231,11 @@ discard block |
||
| 221 | 231 | |
| 222 | 232 | public function getParameter($parameter) |
| 223 | 233 | { |
| 224 | - if($parameter instanceof TDateTime) |
|
| 225 | - return $parameter->getTimestamp(); |
|
| 226 | - else |
|
| 227 | - return $parameter; |
|
| 234 | + if($parameter instanceof TDateTime) { |
|
| 235 | + return $parameter->getTimestamp(); |
|
| 236 | + } else { |
|
| 237 | + return $parameter; |
|
| 238 | + } |
|
| 228 | 239 | } |
| 229 | 240 | |
| 230 | 241 | public function createNewInstance($data=null) |
@@ -239,8 +250,9 @@ discard block |
||
| 239 | 250 | |
| 240 | 251 | public function __construct($datetime=null) |
| 241 | 252 | { |
| 242 | - if(!is_null($datetime)) |
|
| 243 | - $this->setDatetime($datetime); |
|
| 253 | + if(!is_null($datetime)) { |
|
| 254 | + $this->setDatetime($datetime); |
|
| 255 | + } |
|
| 244 | 256 | } |
| 245 | 257 | |
| 246 | 258 | public function getTimestamp() |
@@ -79,7 +79,8 @@ |
||
| 79 | 79 | { |
| 80 | 80 | $props = array('Account_Id', 'Account_FirstName', 'Account_LastName', |
| 81 | 81 | 'Account_Email', 'Account_Banner_Option', 'Account_Cart_Option'); |
| 82 | - foreach($props as $prop) |
|
| 83 | - $this->assertEqual($account1->{$prop}, $account2->{$prop}); |
|
| 82 | + foreach($props as $prop) { |
|
| 83 | + $this->assertEqual($account1->{$prop}, $account2->{$prop}); |
|
| 84 | + } |
|
| 84 | 85 | } |
| 85 | 86 | } |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | $this->initScript('account-init.sql'); |
| 34 | 34 | $accounts = $this->sqlmap->queryForList("getAccountWithOrders"); |
| 35 | 35 | $this->assertIdentical(5, count($accounts)); |
| 36 | - foreach($accounts as $account) |
|
| 37 | - $this->assertIdentical(2, count($account->getOrders())); |
|
| 36 | + foreach($accounts as $account) { |
|
| 37 | + $this->assertIdentical(2, count($account->getOrders())); |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | /**/ |
@@ -2,8 +2,9 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Prado::using('System.Data.TDbConnection'); |
| 4 | 4 | |
| 5 | -if(!defined('SQLMAP_TESTS')) |
|
| 5 | +if(!defined('SQLMAP_TESTS')) { |
|
| 6 | 6 | define('SQLMAP_TESTS', realpath(dirname(__FILE__))); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | if(!class_exists('Account', false)) |
| 9 | 10 | { |
@@ -40,8 +41,9 @@ discard block |
||
| 40 | 41 | foreach($lines as $line) |
| 41 | 42 | { |
| 42 | 43 | $line = trim($line); |
| 43 | - if(strlen($line) > 0) |
|
| 44 | - $connection->createCommand($line)->execute(); |
|
| 44 | + if(strlen($line) > 0) { |
|
| 45 | + $connection->createCommand($line)->execute(); |
|
| 46 | + } |
|
| 45 | 47 | } |
| 46 | 48 | } |
| 47 | 49 | } |
@@ -58,7 +58,8 @@ |
||
| 58 | 58 | $props = array('username', 'password', 'email', 'first_name', 'last_name', 'job_title', |
| 59 | 59 | 'work_phone', 'work_fax', 'active', 'department_id', 'salutation', |
| 60 | 60 | 'hint_question', 'hint_answer'); |
| 61 | - foreach($props as $prop) |
|
| 62 | - $this->assertEqual($user->$prop,$check->$prop); |
|
| 61 | + foreach($props as $prop) { |
|
| 62 | + $this->assertEqual($user->$prop,$check->$prop); |
|
| 63 | + } |
|
| 63 | 64 | } |
| 64 | 65 | } |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $registry->registerRemoved($obj); |
| 59 | 59 | $this->fail(); |
| 60 | - } |
|
| 61 | - catch(TActiveRecordException $e) |
|
| 60 | + } catch(TActiveRecordException $e) |
|
| 62 | 61 | { |
| 63 | 62 | $this->pass(); |
| 64 | 63 | } |
@@ -91,8 +90,7 @@ discard block |
||
| 91 | 90 | { |
| 92 | 91 | $registry->registerClean($obj); |
| 93 | 92 | $this->fail(); |
| 94 | - } |
|
| 95 | - catch(TActiveRecordException $e) |
|
| 93 | + } catch(TActiveRecordException $e) |
|
| 96 | 94 | { |
| 97 | 95 | $this->pass(); |
| 98 | 96 | } |
@@ -128,8 +126,7 @@ discard block |
||
| 128 | 126 | { |
| 129 | 127 | $registry->registerClean($obj); |
| 130 | 128 | $this->fail(); |
| 131 | - } |
|
| 132 | - catch(TActiveRecordException $e) |
|
| 129 | + } catch(TActiveRecordException $e) |
|
| 133 | 130 | { |
| 134 | 131 | $this->pass(); |
| 135 | 132 | } |
@@ -9,8 +9,9 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function getDbConnection() |
| 11 | 11 | { |
| 12 | - if(self::$conn===null) |
|
| 13 | - self::$conn = new TDbConnection('sqlite:'.dirname(__FILE__).'/fk_tests.db'); |
|
| 12 | + if(self::$conn===null) { |
|
| 13 | + self::$conn = new TDbConnection('sqlite:'.dirname(__FILE__).'/fk_tests.db'); |
|
| 14 | + } |
|
| 14 | 15 | return self::$conn; |
| 15 | 16 | } |
| 16 | 17 | } |