Completed
Pull Request — master (#90)
by Reginaldo
18:50
created
lib/Cake/Test/Case/Model/Datasource/DataSourceTest.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 /**
58 58
  * listSources
59 59
  *
60
- * @return boolean
60
+ * @return string[]
61 61
  */
62 62
 	public function listSources() {
63 63
 		return null;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 /**
67 67
  * Returns the schema for the datasource to enable create/update
68 68
  *
69
- * @param object $Model
69
+ * @param Model $Model
70 70
  * @return array
71 71
  */
72 72
 	public function describe(Model $Model) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@
 block discarded – undo
241 241
 			->method('delete')
242 242
 			->with(
243 243
 				$this->equalTo($this->Model),
244
-				$this->equalTo(array($this->Model->alias . '.id' => 1))
244
+				$this->equalTo(array($this->Model->alias.'.id' => 1))
245 245
 			);
246 246
 		$this->Model->delete(1);
247 247
 	}
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Model/models.php 2 patches
Doc Comments   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
  *
170 170
  * @param mixed $value
171 171
  * @param mixed $options
172
- * @return void
172
+ * @return boolean
173 173
  */
174 174
 	public function validateNumber($value, $options) {
175 175
 		$options = array_merge(array('min' => 0, 'max' => 100), $options);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
  * validateTitle method
182 182
  *
183 183
  * @param mixed $value
184
- * @return void
184
+ * @return boolean
185 185
  */
186 186
 	public function validateTitle($value) {
187 187
 		return (!empty($value) && strpos(strtolower($value['title']), 'title-') === 0);
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 /**
284 284
  * beforeSave method
285 285
  *
286
- * @return void
286
+ * @return boolean
287 287
  */
288 288
 	public function beforeSave($options = array()) {
289 289
 		return $this->beforeSaveReturn;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
  * titleDuplicate method
294 294
  *
295 295
  * @param string $title
296
- * @return void
296
+ * @return boolean
297 297
  */
298 298
 	public static function titleDuplicate($title) {
299 299
 		if ($title === 'My Article Title') {
@@ -2164,7 +2164,7 @@  discard block
 block discarded – undo
2164 2164
  * customValidationMethod method
2165 2165
  *
2166 2166
  * @param mixed $data
2167
- * @return void
2167
+ * @return boolean
2168 2168
  */
2169 2169
 	public function customValidationMethod($data) {
2170 2170
 		return $data === 1;
@@ -2173,7 +2173,7 @@  discard block
 block discarded – undo
2173 2173
 /**
2174 2174
  * Custom validator with parameters + default values
2175 2175
  *
2176
- * @return array
2176
+ * @return boolean
2177 2177
  */
2178 2178
 	public function customValidatorWithParams($data, $validator, $or = true, $ignoreOnSame = 'id') {
2179 2179
 		$this->validatorParams = get_defined_vars();
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
 /**
2185 2185
  * Custom validator with message
2186 2186
  *
2187
- * @return array
2187
+ * @return string
2188 2188
  */
2189 2189
 	public function customValidatorWithMessage($data) {
2190 2190
 		return 'This field will *never* validate! Muhahaha!';
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
 /**
2194 2194
  * Test validation with many parameters
2195 2195
  *
2196
- * @return void
2196
+ * @return boolean
2197 2197
  */
2198 2198
 	public function customValidatorWithSixParams($data, $one = 1, $two = 2, $three = 3, $four = 4, $five = 5, $six = 6) {
2199 2199
 		$this->validatorParams = get_defined_vars();
@@ -2243,7 +2243,7 @@  discard block
 block discarded – undo
2243 2243
  * customValidationMethod method
2244 2244
  *
2245 2245
  * @param mixed $data
2246
- * @return void
2246
+ * @return boolean
2247 2247
  */
2248 2248
 	public function customValidationMethod($data) {
2249 2249
 		return $data === 1;
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
  * @param integer $levelLimit
2554 2554
  * @param integer $childLimit
2555 2555
  * @param mixed $currentLevel
2556
- * @param mixed $parent_id
2556
+ * @param mixed $parentId
2557 2557
  * @param string $prefix
2558 2558
  * @param boolean $hierarchal
2559 2559
  * @return void
@@ -4995,7 +4995,7 @@  discard block
 block discarded – undo
4995 4995
  * Alters title data
4996 4996
  *
4997 4997
  * @param array $options Options passed from Model::save().
4998
- * @return boolean True if validate operation should continue, false to abort
4998
+ * @return boolean|null True if validate operation should continue, false to abort
4999 4999
  * @see Model::save()
5000 5000
  */
5001 5001
 	public function beforeValidate($options = array()) {
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
  * @return void
185 185
  */
186 186
 	public function validateTitle($value) {
187
-		return (!empty($value) && strpos(strtolower($value['title']), 'title-') === 0);
187
+		return ( ! empty($value) && strpos(strtolower($value['title']), 'title-') === 0);
188 188
 	}
189 189
 
190 190
 }
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
  * @throws Exception
218 218
  */
219 219
 	public function beforeFind($queryData) {
220
-		if (!empty($queryData['lazyLoad'])) {
221
-			if (!isset($this->Article, $this->Comment, $this->ArticleFeatured)) {
220
+		if ( ! empty($queryData['lazyLoad'])) {
221
+			if ( ! isset($this->Article, $this->Comment, $this->ArticleFeatured)) {
222 222
 				throw new Exception('Unavailable associations');
223 223
 			}
224 224
 		}
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 	public function beforeDelete($cascade = true) {
320 320
 		$db = $this->getDataSource();
321
-		$db->delete($this, array($this->alias . '.' . $this->primaryKey => array(1, 3)));
321
+		$db->delete($this, array($this->alias.'.'.$this->primaryKey => array(1, 3)));
322 322
 		return true;
323 323
 	}
324 324
 
@@ -2559,7 +2559,7 @@  discard block
 block discarded – undo
2559 2559
  * @return void
2560 2560
  */
2561 2561
 	public function initialize($levelLimit = 3, $childLimit = 3, $currentLevel = null, $parentId = null, $prefix = '1', $hierarchal = true) {
2562
-		if (!$parentId) {
2562
+		if ( ! $parentId) {
2563 2563
 			$db = ConnectionManager::getDataSource($this->useDbConfig);
2564 2564
 			$db->truncate($this->table);
2565 2565
 			$this->save(array($this->name => array('name' => '1. Root')));
@@ -2567,12 +2567,12 @@  discard block
 block discarded – undo
2567 2567
 			$this->create(array());
2568 2568
 		}
2569 2569
 
2570
-		if (!$currentLevel || $currentLevel > $levelLimit) {
2570
+		if ( ! $currentLevel || $currentLevel > $levelLimit) {
2571 2571
 			return;
2572 2572
 		}
2573 2573
 
2574 2574
 		for ($i = 1; $i <= $childLimit; $i++) {
2575
-			$name = $prefix . '.' . $i;
2575
+			$name = $prefix.'.'.$i;
2576 2576
 			$data = array($this->name => array('name' => $name));
2577 2577
 			$this->create($data);
2578 2578
 
@@ -3721,7 +3721,7 @@  discard block
 block discarded – undo
3721 3721
  * @return void
3722 3722
  */
3723 3723
 	public function schema($field = false) {
3724
-		if (!isset($this->_schema)) {
3724
+		if ( ! isset($this->_schema)) {
3725 3725
 			$this->_schema = array(
3726 3726
 				'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
3727 3727
 				'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
@@ -3768,7 +3768,7 @@  discard block
 block discarded – undo
3768 3768
  * @return void
3769 3769
  */
3770 3770
 	public function schema($field = false) {
3771
-		if (!isset($this->_schema)) {
3771
+		if ( ! isset($this->_schema)) {
3772 3772
 			$this->_schema = array(
3773 3773
 				'test_model4_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
3774 3774
 				'test_model7_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8')
@@ -3833,7 +3833,7 @@  discard block
 block discarded – undo
3833 3833
  * @return void
3834 3834
  */
3835 3835
 	public function schema($field = false) {
3836
-		if (!isset($this->_schema)) {
3836
+		if ( ! isset($this->_schema)) {
3837 3837
 			$this->_schema = array(
3838 3838
 				'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
3839 3839
 				'test_model4_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
@@ -3893,7 +3893,7 @@  discard block
 block discarded – undo
3893 3893
  * @return void
3894 3894
  */
3895 3895
 	public function schema($field = false) {
3896
-		if (!isset($this->_schema)) {
3896
+		if ( ! isset($this->_schema)) {
3897 3897
 			$this->_schema = array(
3898 3898
 				'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
3899 3899
 				'test_model5_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
@@ -3941,7 +3941,7 @@  discard block
 block discarded – undo
3941 3941
  * @return void
3942 3942
  */
3943 3943
 	public function schema($field = false) {
3944
-		if (!isset($this->_schema)) {
3944
+		if ( ! isset($this->_schema)) {
3945 3945
 			$this->_schema = array(
3946 3946
 				'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
3947 3947
 				'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
@@ -4001,7 +4001,7 @@  discard block
 block discarded – undo
4001 4001
  * @return void
4002 4002
  */
4003 4003
 	public function schema($field = false) {
4004
-		if (!isset($this->_schema)) {
4004
+		if ( ! isset($this->_schema)) {
4005 4005
 			$this->_schema = array(
4006 4006
 				'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
4007 4007
 				'test_model9_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
@@ -4062,7 +4062,7 @@  discard block
 block discarded – undo
4062 4062
  * @return void
4063 4063
  */
4064 4064
 	public function schema($field = false) {
4065
-		if (!isset($this->_schema)) {
4065
+		if ( ! isset($this->_schema)) {
4066 4066
 			$this->_schema = array(
4067 4067
 				'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'),
4068 4068
 				'test_model8_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '11'),
@@ -4124,7 +4124,7 @@  discard block
 block discarded – undo
4124 4124
  * @return void
4125 4125
  */
4126 4126
 	public function schema($field = false) {
4127
-		if (!isset($this->_schema)) {
4127
+		if ( ! isset($this->_schema)) {
4128 4128
 			$this->_schema = array(
4129 4129
 				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
4130 4130
 				'name' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => '20'),
@@ -4183,7 +4183,7 @@  discard block
 block discarded – undo
4183 4183
  * @return void
4184 4184
  */
4185 4185
 	public function schema($field = false) {
4186
-		if (!isset($this->_schema)) {
4186
+		if ( ! isset($this->_schema)) {
4187 4187
 			$this->_schema = array(
4188 4188
 				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
4189 4189
 				'level_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
@@ -4254,7 +4254,7 @@  discard block
 block discarded – undo
4254 4254
  * @return void
4255 4255
  */
4256 4256
 	public function schema($field = false) {
4257
-		if (!isset($this->_schema)) {
4257
+		if ( ! isset($this->_schema)) {
4258 4258
 			$this->_schema = array(
4259 4259
 				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
4260 4260
 				'group_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
@@ -4334,7 +4334,7 @@  discard block
 block discarded – undo
4334 4334
  * @return void
4335 4335
  */
4336 4336
 	public function schema($field = false) {
4337
-		if (!isset($this->_schema)) {
4337
+		if ( ! isset($this->_schema)) {
4338 4338
 			$this->_schema = array(
4339 4339
 				'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),
4340 4340
 				'group_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),
@@ -4394,7 +4394,7 @@  discard block
 block discarded – undo
4394 4394
  * @return void
4395 4395
  */
4396 4396
 	public function schema($field = false) {
4397
-		if (!isset($this->_schema)) {
4397
+		if ( ! isset($this->_schema)) {
4398 4398
 			$this->_schema = array(
4399 4399
 				'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),
4400 4400
 				'category_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),
@@ -4456,7 +4456,7 @@  discard block
 block discarded – undo
4456 4456
  * @return void
4457 4457
  */
4458 4458
 	public function schema($field = false) {
4459
-		if (!isset($this->_schema)) {
4459
+		if ( ! isset($this->_schema)) {
4460 4460
 			$this->_schema = array(
4461 4461
 				'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),
4462 4462
 				'parent_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '10'),
@@ -4515,7 +4515,7 @@  discard block
 block discarded – undo
4515 4515
  * @return void
4516 4516
  */
4517 4517
 	public function schema($field = false) {
4518
-		if (!isset($this->_schema)) {
4518
+		if ( ! isset($this->_schema)) {
4519 4519
 			$this->_schema = array(
4520 4520
 				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
4521 4521
 				'article_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),
@@ -4569,7 +4569,7 @@  discard block
 block discarded – undo
4569 4569
  * @return void
4570 4570
  */
4571 4571
 	public function schema($field = false) {
4572
-		if (!isset($this->_schema)) {
4572
+		if ( ! isset($this->_schema)) {
4573 4573
 			$this->_schema = array(
4574 4574
 				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
4575 4575
 				'article_featured_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),
@@ -4644,7 +4644,7 @@  discard block
 block discarded – undo
4644 4644
  * @return void
4645 4645
  */
4646 4646
 	public function schema($field = false) {
4647
-		if (!isset($this->_schema)) {
4647
+		if ( ! isset($this->_schema)) {
4648 4648
 			$this->_schema = array(
4649 4649
 				'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => '10'),
4650 4650
 				'category_featured_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => '10'),
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Network/Email/CakeEmailTest.php 3 patches
Doc Comments   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 /**
52 52
  * Wrap to protected method
53 53
  *
54
- * @return array
54
+ * @return string[]
55 55
  */
56 56
 	public function wrap($text, $length = CakeEmail::LINE_LENGTH_MUST) {
57 57
 		return parent::_wrap($text, $length);
@@ -1981,6 +1981,9 @@  discard block
 block discarded – undo
1981 1981
 		$this->assertContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
1982 1982
 	}
1983 1983
 
1984
+	/**
1985
+	 * @param string $charset
1986
+	 */
1984 1987
 	protected function _checkContentTransferEncoding($message, $charset) {
1985 1988
 		$boundary = '--alt-' . $this->CakeEmail->getBoundary();
1986 1989
 		$result['text'] = false;
@@ -2119,8 +2122,8 @@  discard block
 block discarded – undo
2119 2122
 	}
2120 2123
 
2121 2124
 /**
2122
- * @param mixed $charset
2123
- * @param mixed $headerCharset
2125
+ * @param string $charset
2126
+ * @param null|string $headerCharset
2124 2127
  * @return CakeEmail
2125 2128
  */
2126 2129
 	protected function _getEmailByOldStyleCharset($charset, $headerCharset) {
@@ -2143,8 +2146,8 @@  discard block
 block discarded – undo
2143 2146
 	}
2144 2147
 
2145 2148
 /**
2146
- * @param mixed $charset
2147
- * @param mixed $headerCharset
2149
+ * @param string $charset
2150
+ * @param null|string $headerCharset
2148 2151
  * @return CakeEmail
2149 2152
  */
2150 2153
 	protected function _getEmailByNewStyleCharset($charset, $headerCharset) {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1202,10 +1202,10 @@
 block discarded – undo
1202 1202
 		$this->assertContains('--' . $boundary . '--', $result['message']);
1203 1203
 	}
1204 1204
 /**
1205
- * testSendWithLog method
1206
- *
1207
- * @return void
1208
- */
1205
+	 * testSendWithLog method
1206
+	 *
1207
+	 * @return void
1208
+	 */
1209 1209
 	public function testSendWithLog() {
1210 1210
 		CakeLog::config('email', array(
1211 1211
 			'engine' => 'File',
Please login to merge, or discard this patch.
Spacing   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		$this->CakeEmail = new TestCakeEmail();
149 149
 
150 150
 		App::build(array(
151
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
151
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS)
152 152
 		));
153 153
 	}
154 154
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
  * @return void
427 427
  */
428 428
 	public function testFormatAddressJapanese() {
429
-		$this->skipIf(!function_exists('mb_convert_encoding'));
429
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
430 430
 
431 431
 		$this->CakeEmail->headerCharset = 'ISO-2022-JP';
432 432
 		$result = $this->CakeEmail->formatAddress(array('[email protected]' => '日本語Test'));
@@ -434,11 +434,11 @@  discard block
 block discarded – undo
434 434
 		$this->assertSame($expected, $result);
435 435
 
436 436
 		$result = $this->CakeEmail->formatAddress(array('[email protected]' => '寿限無寿限無五劫の擦り切れ海砂利水魚の水行末雲来末風来末食う寝る処に住む処やぶら小路の藪柑子パイポパイポパイポのシューリンガンシューリンガンのグーリンダイグーリンダイのポンポコピーのポンポコナーの長久命の長助'));
437
-		$expected = array("=?ISO-2022-JP?B?GyRCPHc4Qkw1PHc4Qkw1OF45ZSROOyQkakBaJGwzJDo9TXg/ZTV7GyhC?=\r\n" .
438
-			" =?ISO-2022-JP?B?GyRCJE4/ZTlUS3YxQE1oS3ZJd01oS3Y/KSQmPzIkaz1oJEs9OyRgGyhC?=\r\n" .
439
-			" =?ISO-2022-JP?B?GyRCPWgkZCRWJGk+Lk8pJE5pLjQ7O1IlUSUkJV0lUSUkJV0lUSUkGyhC?=\r\n" .
440
-			" =?ISO-2022-JP?B?GyRCJV0kTiU3JWUhPCVqJXMlLCVzJTclZSE8JWolcyUsJXMkTiUwGyhC?=\r\n" .
441
-			" =?ISO-2022-JP?B?GyRCITwlaiVzJUAlJCUwITwlaiVzJUAlJCROJV0lcyVdJTMlVCE8GyhC?=\r\n" .
437
+		$expected = array("=?ISO-2022-JP?B?GyRCPHc4Qkw1PHc4Qkw1OF45ZSROOyQkakBaJGwzJDo9TXg/ZTV7GyhC?=\r\n".
438
+			" =?ISO-2022-JP?B?GyRCJE4/ZTlUS3YxQE1oS3ZJd01oS3Y/KSQmPzIkaz1oJEs9OyRgGyhC?=\r\n".
439
+			" =?ISO-2022-JP?B?GyRCPWgkZCRWJGk+Lk8pJE5pLjQ7O1IlUSUkJV0lUSUkJV0lUSUkGyhC?=\r\n".
440
+			" =?ISO-2022-JP?B?GyRCJV0kTiU3JWUhPCVqJXMlLCVzJTclZSE8JWolcyUsJXMkTiUwGyhC?=\r\n".
441
+			" =?ISO-2022-JP?B?GyRCITwlaiVzJUAlJCUwITwlaiVzJUAlJCROJV0lcyVdJTMlVCE8GyhC?=\r\n".
442 442
 			" =?ISO-2022-JP?B?GyRCJE4lXSVzJV0lMyVKITwkTkQ5NVdMPyRORDk9dRsoQg==?= <[email protected]>");
443 443
 		$this->assertSame($expected, $result);
444 444
 	}
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 		$this->assertSame($this->CakeEmail->subject(), '1');
564 564
 
565 565
 		$this->CakeEmail->subject('هذه رسالة بعنوان طويل مرسل للمستلم');
566
-		$expected = '=?UTF-8?B?2YfYsNmHINix2LPYp9mE2Kkg2KjYudmG2YjYp9mGINi32YjZitmEINmF2LE=?=' . "\r\n" . ' =?UTF-8?B?2LPZhCDZhNmE2YXYs9iq2YTZhQ==?=';
566
+		$expected = '=?UTF-8?B?2YfYsNmHINix2LPYp9mE2Kkg2KjYudmG2YjYp9mGINi32YjZitmEINmF2LE=?='."\r\n".' =?UTF-8?B?2LPZhCDZhNmE2YXYs9iq2YTZhQ==?=';
567 567
 		$this->assertSame($this->CakeEmail->subject(), $expected);
568 568
 	}
569 569
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
  * @return void
574 574
  */
575 575
 	public function testSubjectJapanese() {
576
-		$this->skipIf(!function_exists('mb_convert_encoding'));
576
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
577 577
 		mb_internal_encoding('UTF-8');
578 578
 
579 579
 		$this->CakeEmail->headerCharset = 'ISO-2022-JP';
@@ -582,8 +582,8 @@  discard block
 block discarded – undo
582 582
 		$this->assertSame($this->CakeEmail->subject(), $expected);
583 583
 
584 584
 		$this->CakeEmail->subject('長い長い長いSubjectの場合はfoldingするのが正しいんだけどいったいどうなるんだろう?');
585
-		$expected = "=?ISO-2022-JP?B?GyRCRDkkJEQ5JCREOSQkGyhCU3ViamVjdBskQiROPmw5ZyRPGyhCZm9s?=\r\n" .
586
-			" =?ISO-2022-JP?B?ZGluZxskQiQ5JGskTiQsQDUkNyQkJHMkQCQxJEkkJCRDJD8kJCRJGyhC?=\r\n" .
585
+		$expected = "=?ISO-2022-JP?B?GyRCRDkkJEQ5JCREOSQkGyhCU3ViamVjdBskQiROPmw5ZyRPGyhCZm9s?=\r\n".
586
+			" =?ISO-2022-JP?B?ZGluZxskQiQ5JGskTiQsQDUkNyQkJHMkQCQxJEkkJCRDJD8kJCRJGyhC?=\r\n".
587 587
 			" =?ISO-2022-JP?B?GyRCJCYkSiRrJHMkQCRtJCYhKRsoQg==?=";
588 588
 		$this->assertSame($this->CakeEmail->subject(), $expected);
589 589
 	}
@@ -766,10 +766,10 @@  discard block
 block discarded – undo
766 766
  * @return void
767 767
  */
768 768
 	public function testAttachments() {
769
-		$this->CakeEmail->attachments(CAKE . 'basics.php');
769
+		$this->CakeEmail->attachments(CAKE.'basics.php');
770 770
 		$expected = array(
771 771
 			'basics.php' => array(
772
-				'file' => CAKE . 'basics.php',
772
+				'file' => CAKE.'basics.php',
773 773
 				'mimetype' => 'application/octet-stream'
774 774
 			)
775 775
 		);
@@ -779,21 +779,21 @@  discard block
 block discarded – undo
779 779
 		$this->assertSame($this->CakeEmail->attachments(), array());
780 780
 
781 781
 		$this->CakeEmail->attachments(array(
782
-			array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain')
782
+			array('file' => CAKE.'basics.php', 'mimetype' => 'text/plain')
783 783
 		));
784
-		$this->CakeEmail->addAttachments(CAKE . 'bootstrap.php');
785
-		$this->CakeEmail->addAttachments(array(CAKE . 'bootstrap.php'));
786
-		$this->CakeEmail->addAttachments(array('other.txt' => CAKE . 'bootstrap.php', 'license' => CAKE . 'LICENSE.txt'));
784
+		$this->CakeEmail->addAttachments(CAKE.'bootstrap.php');
785
+		$this->CakeEmail->addAttachments(array(CAKE.'bootstrap.php'));
786
+		$this->CakeEmail->addAttachments(array('other.txt' => CAKE.'bootstrap.php', 'license' => CAKE.'LICENSE.txt'));
787 787
 		$expected = array(
788
-			'basics.php' => array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain'),
789
-			'bootstrap.php' => array('file' => CAKE . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
790
-			'other.txt' => array('file' => CAKE . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
791
-			'license' => array('file' => CAKE . 'LICENSE.txt', 'mimetype' => 'application/octet-stream')
788
+			'basics.php' => array('file' => CAKE.'basics.php', 'mimetype' => 'text/plain'),
789
+			'bootstrap.php' => array('file' => CAKE.'bootstrap.php', 'mimetype' => 'application/octet-stream'),
790
+			'other.txt' => array('file' => CAKE.'bootstrap.php', 'mimetype' => 'application/octet-stream'),
791
+			'license' => array('file' => CAKE.'LICENSE.txt', 'mimetype' => 'application/octet-stream')
792 792
 		);
793 793
 		$this->assertSame($this->CakeEmail->attachments(), $expected);
794 794
 
795 795
 		$this->setExpectedException('SocketException');
796
-		$this->CakeEmail->attachments(array(array('nofile' => CAKE . 'basics.php', 'mimetype' => 'text/plain')));
796
+		$this->CakeEmail->attachments(array(array('nofile' => CAKE.'basics.php', 'mimetype' => 'text/plain')));
797 797
 	}
798 798
 
799 799
 /**
@@ -948,15 +948,15 @@  discard block
 block discarded – undo
948 948
 		$expected = "Here is my body, with multi lines.\r\nThis is the second line.\r\n\r\nAnd the last.\r\n\r\n";
949 949
 
950 950
 		$this->assertEquals($expected, $result['message']);
951
-		$this->assertTrue((bool)strpos($result['headers'], 'Date: '));
952
-		$this->assertTrue((bool)strpos($result['headers'], 'Message-ID: '));
953
-		$this->assertTrue((bool)strpos($result['headers'], 'To: '));
951
+		$this->assertTrue((bool) strpos($result['headers'], 'Date: '));
952
+		$this->assertTrue((bool) strpos($result['headers'], 'Message-ID: '));
953
+		$this->assertTrue((bool) strpos($result['headers'], 'To: '));
954 954
 
955 955
 		$result = $this->CakeEmail->send("Other body");
956 956
 		$expected = "Other body\r\n\r\n";
957 957
 		$this->assertSame($result['message'], $expected);
958
-		$this->assertTrue((bool)strpos($result['headers'], 'Message-ID: '));
959
-		$this->assertTrue((bool)strpos($result['headers'], 'To: '));
958
+		$this->assertTrue((bool) strpos($result['headers'], 'Message-ID: '));
959
+		$this->assertTrue((bool) strpos($result['headers'], 'To: '));
960 960
 
961 961
 		$this->CakeEmail->reset();
962 962
 		$this->CakeEmail->transport('Debug');
@@ -1008,22 +1008,22 @@  discard block
 block discarded – undo
1008 1008
 		$this->CakeEmail->to('[email protected]');
1009 1009
 		$this->CakeEmail->subject('My title');
1010 1010
 		$this->CakeEmail->emailFormat('text');
1011
-		$this->CakeEmail->attachments(array(CAKE . 'basics.php'));
1011
+		$this->CakeEmail->attachments(array(CAKE.'basics.php'));
1012 1012
 		$result = $this->CakeEmail->send('Hello');
1013 1013
 
1014 1014
 		$boundary = $this->CakeEmail->getBoundary();
1015
-		$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
1016
-		$expected = "--$boundary\r\n" .
1017
-			"Content-Type: text/plain; charset=UTF-8\r\n" .
1018
-			"Content-Transfer-Encoding: 8bit\r\n" .
1019
-			"\r\n" .
1020
-			"Hello" .
1021
-			"\r\n" .
1022
-			"\r\n" .
1023
-			"\r\n" .
1024
-			"--$boundary\r\n" .
1025
-			"Content-Type: application/octet-stream\r\n" .
1026
-			"Content-Transfer-Encoding: base64\r\n" .
1015
+		$this->assertContains('Content-Type: multipart/mixed; boundary="'.$boundary.'"', $result['headers']);
1016
+		$expected = "--$boundary\r\n".
1017
+			"Content-Type: text/plain; charset=UTF-8\r\n".
1018
+			"Content-Transfer-Encoding: 8bit\r\n".
1019
+			"\r\n".
1020
+			"Hello".
1021
+			"\r\n".
1022
+			"\r\n".
1023
+			"\r\n".
1024
+			"--$boundary\r\n".
1025
+			"Content-Type: application/octet-stream\r\n".
1026
+			"Content-Transfer-Encoding: base64\r\n".
1027 1027
 			"Content-Disposition: attachment; filename=\"basics.php\"\r\n\r\n";
1028 1028
 		$this->assertContains($expected, $result['message']);
1029 1029
 	}
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
 		$this->CakeEmail->to('[email protected]');
1041 1041
 		$this->CakeEmail->subject('My title');
1042 1042
 		$this->CakeEmail->emailFormat('text');
1043
-		$data = file_get_contents(CAKE . 'Console/Templates/skel/webroot/img/cake.icon.png');
1043
+		$data = file_get_contents(CAKE.'Console/Templates/skel/webroot/img/cake.icon.png');
1044 1044
 		$this->CakeEmail->attachments(array('cake.icon.png' => array(
1045 1045
 				'data' => $data,
1046 1046
 				'mimetype' => 'image/png'
@@ -1048,18 +1048,18 @@  discard block
 block discarded – undo
1048 1048
 		$result = $this->CakeEmail->send('Hello');
1049 1049
 
1050 1050
 		$boundary = $this->CakeEmail->getBoundary();
1051
-		$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
1052
-		$expected = "--$boundary\r\n" .
1053
-				"Content-Type: text/plain; charset=UTF-8\r\n" .
1054
-				"Content-Transfer-Encoding: 8bit\r\n" .
1055
-				"\r\n" .
1056
-				"Hello" .
1057
-				"\r\n" .
1058
-				"\r\n" .
1059
-				"\r\n" .
1060
-				"--$boundary\r\n" .
1061
-				"Content-Type: image/png\r\n" .
1062
-				"Content-Transfer-Encoding: base64\r\n" .
1051
+		$this->assertContains('Content-Type: multipart/mixed; boundary="'.$boundary.'"', $result['headers']);
1052
+		$expected = "--$boundary\r\n".
1053
+				"Content-Type: text/plain; charset=UTF-8\r\n".
1054
+				"Content-Transfer-Encoding: 8bit\r\n".
1055
+				"\r\n".
1056
+				"Hello".
1057
+				"\r\n".
1058
+				"\r\n".
1059
+				"\r\n".
1060
+				"--$boundary\r\n".
1061
+				"Content-Type: image/png\r\n".
1062
+				"Content-Transfer-Encoding: base64\r\n".
1063 1063
 				"Content-Disposition: attachment; filename=\"cake.icon.png\"\r\n\r\n";
1064 1064
 		$expected .= chunk_split(base64_encode($data), 76, "\r\n");
1065 1065
 		$this->assertContains($expected, $result['message']);
@@ -1076,35 +1076,35 @@  discard block
 block discarded – undo
1076 1076
 		$this->CakeEmail->to('[email protected]');
1077 1077
 		$this->CakeEmail->subject('My title');
1078 1078
 		$this->CakeEmail->emailFormat('both');
1079
-		$this->CakeEmail->attachments(array(CAKE . 'VERSION.txt'));
1079
+		$this->CakeEmail->attachments(array(CAKE.'VERSION.txt'));
1080 1080
 		$result = $this->CakeEmail->send('Hello');
1081 1081
 
1082 1082
 		$boundary = $this->CakeEmail->getBoundary();
1083
-		$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
1084
-		$expected = "--$boundary\r\n" .
1085
-			"Content-Type: multipart/alternative; boundary=\"alt-$boundary\"\r\n" .
1086
-			"\r\n" .
1087
-			"--alt-$boundary\r\n" .
1088
-			"Content-Type: text/plain; charset=UTF-8\r\n" .
1089
-			"Content-Transfer-Encoding: 8bit\r\n" .
1090
-			"\r\n" .
1091
-			"Hello" .
1092
-			"\r\n" .
1093
-			"\r\n" .
1094
-			"\r\n" .
1095
-			"--alt-$boundary\r\n" .
1096
-			"Content-Type: text/html; charset=UTF-8\r\n" .
1097
-			"Content-Transfer-Encoding: 8bit\r\n" .
1098
-			"\r\n" .
1099
-			"Hello" .
1100
-			"\r\n" .
1101
-			"\r\n" .
1102
-			"\r\n" .
1103
-			"--alt-{$boundary}--\r\n" .
1104
-			"\r\n" .
1105
-			"--$boundary\r\n" .
1106
-			"Content-Type: application/octet-stream\r\n" .
1107
-			"Content-Transfer-Encoding: base64\r\n" .
1083
+		$this->assertContains('Content-Type: multipart/mixed; boundary="'.$boundary.'"', $result['headers']);
1084
+		$expected = "--$boundary\r\n".
1085
+			"Content-Type: multipart/alternative; boundary=\"alt-$boundary\"\r\n".
1086
+			"\r\n".
1087
+			"--alt-$boundary\r\n".
1088
+			"Content-Type: text/plain; charset=UTF-8\r\n".
1089
+			"Content-Transfer-Encoding: 8bit\r\n".
1090
+			"\r\n".
1091
+			"Hello".
1092
+			"\r\n".
1093
+			"\r\n".
1094
+			"\r\n".
1095
+			"--alt-$boundary\r\n".
1096
+			"Content-Type: text/html; charset=UTF-8\r\n".
1097
+			"Content-Transfer-Encoding: 8bit\r\n".
1098
+			"\r\n".
1099
+			"Hello".
1100
+			"\r\n".
1101
+			"\r\n".
1102
+			"\r\n".
1103
+			"--alt-{$boundary}--\r\n".
1104
+			"\r\n".
1105
+			"--$boundary\r\n".
1106
+			"Content-Type: application/octet-stream\r\n".
1107
+			"Content-Transfer-Encoding: base64\r\n".
1108 1108
 			"Content-Disposition: attachment; filename=\"VERSION.txt\"\r\n\r\n";
1109 1109
 		$this->assertContains($expected, $result['message']);
1110 1110
 	}
@@ -1122,46 +1122,46 @@  discard block
 block discarded – undo
1122 1122
 		$this->CakeEmail->emailFormat('both');
1123 1123
 		$this->CakeEmail->attachments(array(
1124 1124
 			'cake.png' => array(
1125
-				'file' => CAKE . 'VERSION.txt',
1125
+				'file' => CAKE.'VERSION.txt',
1126 1126
 				'contentId' => 'abc123'
1127 1127
 			)
1128 1128
 		));
1129 1129
 		$result = $this->CakeEmail->send('Hello');
1130 1130
 
1131 1131
 		$boundary = $this->CakeEmail->getBoundary();
1132
-		$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
1133
-		$expected = "--$boundary\r\n" .
1134
-			"Content-Type: multipart/related; boundary=\"rel-$boundary\"\r\n" .
1135
-			"\r\n" .
1136
-			"--rel-$boundary\r\n" .
1137
-			"Content-Type: multipart/alternative; boundary=\"alt-$boundary\"\r\n" .
1138
-			"\r\n" .
1139
-			"--alt-$boundary\r\n" .
1140
-			"Content-Type: text/plain; charset=UTF-8\r\n" .
1141
-			"Content-Transfer-Encoding: 8bit\r\n" .
1142
-			"\r\n" .
1143
-			"Hello" .
1144
-			"\r\n" .
1145
-			"\r\n" .
1146
-			"\r\n" .
1147
-			"--alt-$boundary\r\n" .
1148
-			"Content-Type: text/html; charset=UTF-8\r\n" .
1149
-			"Content-Transfer-Encoding: 8bit\r\n" .
1150
-			"\r\n" .
1151
-			"Hello" .
1152
-			"\r\n" .
1153
-			"\r\n" .
1154
-			"\r\n" .
1155
-			"--alt-{$boundary}--\r\n" .
1156
-			"\r\n" .
1157
-			"--rel-$boundary\r\n" .
1158
-			"Content-Type: application/octet-stream\r\n" .
1159
-			"Content-Transfer-Encoding: base64\r\n" .
1160
-			"Content-ID: <abc123>\r\n" .
1132
+		$this->assertContains('Content-Type: multipart/mixed; boundary="'.$boundary.'"', $result['headers']);
1133
+		$expected = "--$boundary\r\n".
1134
+			"Content-Type: multipart/related; boundary=\"rel-$boundary\"\r\n".
1135
+			"\r\n".
1136
+			"--rel-$boundary\r\n".
1137
+			"Content-Type: multipart/alternative; boundary=\"alt-$boundary\"\r\n".
1138
+			"\r\n".
1139
+			"--alt-$boundary\r\n".
1140
+			"Content-Type: text/plain; charset=UTF-8\r\n".
1141
+			"Content-Transfer-Encoding: 8bit\r\n".
1142
+			"\r\n".
1143
+			"Hello".
1144
+			"\r\n".
1145
+			"\r\n".
1146
+			"\r\n".
1147
+			"--alt-$boundary\r\n".
1148
+			"Content-Type: text/html; charset=UTF-8\r\n".
1149
+			"Content-Transfer-Encoding: 8bit\r\n".
1150
+			"\r\n".
1151
+			"Hello".
1152
+			"\r\n".
1153
+			"\r\n".
1154
+			"\r\n".
1155
+			"--alt-{$boundary}--\r\n".
1156
+			"\r\n".
1157
+			"--rel-$boundary\r\n".
1158
+			"Content-Type: application/octet-stream\r\n".
1159
+			"Content-Transfer-Encoding: base64\r\n".
1160
+			"Content-ID: <abc123>\r\n".
1161 1161
 			"Content-Disposition: inline; filename=\"cake.png\"\r\n\r\n";
1162 1162
 		$this->assertContains($expected, $result['message']);
1163
-		$this->assertContains('--rel-' . $boundary . '--', $result['message']);
1164
-		$this->assertContains('--' . $boundary . '--', $result['message']);
1163
+		$this->assertContains('--rel-'.$boundary.'--', $result['message']);
1164
+		$this->assertContains('--'.$boundary.'--', $result['message']);
1165 1165
 	}
1166 1166
 
1167 1167
 /**
@@ -1177,29 +1177,29 @@  discard block
 block discarded – undo
1177 1177
 		$this->CakeEmail->emailFormat('text');
1178 1178
 		$this->CakeEmail->attachments(array(
1179 1179
 			'cake.png' => array(
1180
-				'file' => CAKE . 'VERSION.txt',
1180
+				'file' => CAKE.'VERSION.txt',
1181 1181
 				'contentDisposition' => false
1182 1182
 			)
1183 1183
 		));
1184 1184
 		$result = $this->CakeEmail->send('Hello');
1185 1185
 
1186 1186
 		$boundary = $this->CakeEmail->getBoundary();
1187
-		$this->assertContains('Content-Type: multipart/mixed; boundary="' . $boundary . '"', $result['headers']);
1188
-		$expected = "--$boundary\r\n" .
1189
-			"Content-Type: text/plain; charset=UTF-8\r\n" .
1190
-			"Content-Transfer-Encoding: 8bit\r\n" .
1191
-			"\r\n" .
1192
-			"Hello" .
1193
-			"\r\n" .
1194
-			"\r\n" .
1195
-			"\r\n" .
1196
-			"--{$boundary}\r\n" .
1197
-			"Content-Type: application/octet-stream\r\n" .
1198
-			"Content-Transfer-Encoding: base64\r\n" .
1187
+		$this->assertContains('Content-Type: multipart/mixed; boundary="'.$boundary.'"', $result['headers']);
1188
+		$expected = "--$boundary\r\n".
1189
+			"Content-Type: text/plain; charset=UTF-8\r\n".
1190
+			"Content-Transfer-Encoding: 8bit\r\n".
1191
+			"\r\n".
1192
+			"Hello".
1193
+			"\r\n".
1194
+			"\r\n".
1195
+			"\r\n".
1196
+			"--{$boundary}\r\n".
1197
+			"Content-Type: application/octet-stream\r\n".
1198
+			"Content-Transfer-Encoding: base64\r\n".
1199 1199
 			"\r\n";
1200 1200
 
1201 1201
 		$this->assertContains($expected, $result['message']);
1202
-		$this->assertContains('--' . $boundary . '--', $result['message']);
1202
+		$this->assertContains('--'.$boundary.'--', $result['message']);
1203 1203
 	}
1204 1204
 /**
1205 1205
  * testSendWithLog method
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
 		$result = $this->CakeEmail->send("Logging This");
1221 1221
 
1222 1222
 		App::uses('File', 'Utility');
1223
-		$File = new File(TMP . 'cake_test_emails.log');
1223
+		$File = new File(TMP.'cake_test_emails.log');
1224 1224
 		$log = $File->read();
1225 1225
 		$this->assertTrue(strpos($log, $result['headers']) !== false);
1226 1226
 		$this->assertTrue(strpos($log, $result['message']) !== false);
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 		$result = $this->CakeEmail->send("Logging This");
1250 1250
 
1251 1251
 		App::uses('File', 'Utility');
1252
-		$File = new File(TMP . 'cake_test_emails.log');
1252
+		$File = new File(TMP.'cake_test_emails.log');
1253 1253
 		$log = $File->read();
1254 1254
 		$this->assertTrue(strpos($log, $result['headers']) !== false);
1255 1255
 		$this->assertTrue(strpos($log, $result['message']) !== false);
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
  * @return void
1305 1305
  */
1306 1306
 	public function testSendRenderJapanese() {
1307
-		$this->skipIf(!function_exists('mb_convert_encoding'));
1307
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
1308 1308
 
1309 1309
 		$this->CakeEmail->reset();
1310 1310
 		$this->CakeEmail->transport('debug');
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
  * @return void
1394 1394
  */
1395 1395
 	public function testSendRenderWithVarsJapanese() {
1396
-		$this->skipIf(!function_exists('mb_convert_encoding'));
1396
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
1397 1397
 		$this->CakeEmail->reset();
1398 1398
 		$this->CakeEmail->transport('debug');
1399 1399
 
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 		$result = $this->CakeEmail->send();
1408 1408
 
1409 1409
 		$expected = mb_convert_encoding('ここにあなたの設定した値が入ります: 日本語の差し込み123', 'ISO-2022-JP');
1410
-		$this->assertTrue((bool)strpos($result['message'], $expected));
1410
+		$this->assertTrue((bool) strpos($result['message'], $expected));
1411 1411
 	}
1412 1412
 
1413 1413
 /**
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
 		$this->assertInstanceOf('CakeEmail', $result);
1432 1432
 
1433 1433
 		$result = $this->CakeEmail->send();
1434
-		$this->assertTrue((bool)strpos($result['message'], 'Right now: ' . date('Y-m-d\TH:i:s\Z', $timestamp)));
1434
+		$this->assertTrue((bool) strpos($result['message'], 'Right now: '.date('Y-m-d\TH:i:s\Z', $timestamp)));
1435 1435
 
1436 1436
 		$result = $this->CakeEmail->helpers();
1437 1437
 		$this->assertEquals(array('Time'), $result);
@@ -1455,10 +1455,10 @@  discard block
 block discarded – undo
1455 1455
 		$server = env('SERVER_NAME') ? env('SERVER_NAME') : 'localhost';
1456 1456
 
1457 1457
 		if (env('SERVER_PORT') && env('SERVER_PORT') != 80) {
1458
-			$server .= ':' . env('SERVER_PORT');
1458
+			$server .= ':'.env('SERVER_PORT');
1459 1459
 		}
1460 1460
 
1461
-		$expected = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100" />';
1461
+		$expected = '<img src="http://'.$server.'/img/image.gif" alt="cool image" width="100" height="100" />';
1462 1462
 		$result = $this->CakeEmail->send();
1463 1463
 		$this->assertContains($expected, $result['message']);
1464 1464
 	}
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
  */
1471 1471
 	public function testSendRenderPlugin() {
1472 1472
 		App::build(array(
1473
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
1473
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS)
1474 1474
 		));
1475 1475
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
1476 1476
 
@@ -1537,10 +1537,10 @@  discard block
 block discarded – undo
1537 1537
 		$message = $this->CakeEmail->message();
1538 1538
 		$boundary = $this->CakeEmail->getBoundary();
1539 1539
 		$this->assertFalse(empty($boundary));
1540
-		$this->assertContains('--' . $boundary, $message);
1541
-		$this->assertContains('--' . $boundary . '--', $message);
1542
-		$this->assertContains('--alt-' . $boundary, $message);
1543
-		$this->assertContains('--alt-' . $boundary . '--', $message);
1540
+		$this->assertContains('--'.$boundary, $message);
1541
+		$this->assertContains('--'.$boundary.'--', $message);
1542
+		$this->assertContains('--alt-'.$boundary, $message);
1543
+		$this->assertContains('--alt-'.$boundary.'--', $message);
1544 1544
 
1545 1545
 		$this->CakeEmail->attachments(array('fake.php' => __FILE__));
1546 1546
 		$this->CakeEmail->send();
@@ -1548,10 +1548,10 @@  discard block
 block discarded – undo
1548 1548
 		$message = $this->CakeEmail->message();
1549 1549
 		$boundary = $this->CakeEmail->getBoundary();
1550 1550
 		$this->assertFalse(empty($boundary));
1551
-		$this->assertContains('--' . $boundary, $message);
1552
-		$this->assertContains('--' . $boundary . '--', $message);
1553
-		$this->assertContains('--alt-' . $boundary, $message);
1554
-		$this->assertContains('--alt-' . $boundary . '--', $message);
1551
+		$this->assertContains('--'.$boundary, $message);
1552
+		$this->assertContains('--'.$boundary.'--', $message);
1553
+		$this->assertContains('--alt-'.$boundary, $message);
1554
+		$this->assertContains('--alt-'.$boundary.'--', $message);
1555 1555
 	}
1556 1556
 
1557 1557
 /**
@@ -1566,19 +1566,19 @@  discard block
 block discarded – undo
1566 1566
 		$this->CakeEmail->to(array('[email protected]' => 'You'));
1567 1567
 		$this->CakeEmail->subject('My title');
1568 1568
 		$this->CakeEmail->config(array());
1569
-		$this->CakeEmail->attachments(array(CAKE . 'basics.php'));
1569
+		$this->CakeEmail->attachments(array(CAKE.'basics.php'));
1570 1570
 		$result = $this->CakeEmail->send('body');
1571 1571
 		$this->assertContains("Content-Type: application/octet-stream\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"basics.php\"", $result['message']);
1572 1572
 
1573
-		$this->CakeEmail->attachments(array('my.file.txt' => CAKE . 'basics.php'));
1573
+		$this->CakeEmail->attachments(array('my.file.txt' => CAKE.'basics.php'));
1574 1574
 		$result = $this->CakeEmail->send('body');
1575 1575
 		$this->assertContains("Content-Type: application/octet-stream\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"my.file.txt\"", $result['message']);
1576 1576
 
1577
-		$this->CakeEmail->attachments(array('file.txt' => array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain')));
1577
+		$this->CakeEmail->attachments(array('file.txt' => array('file' => CAKE.'basics.php', 'mimetype' => 'text/plain')));
1578 1578
 		$result = $this->CakeEmail->send('body');
1579 1579
 		$this->assertContains("Content-Type: text/plain\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=\"file.txt\"", $result['message']);
1580 1580
 
1581
-		$this->CakeEmail->attachments(array('file2.txt' => array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain', 'contentId' => 'a1b1c1')));
1581
+		$this->CakeEmail->attachments(array('file2.txt' => array('file' => CAKE.'basics.php', 'mimetype' => 'text/plain', 'contentId' => 'a1b1c1')));
1582 1582
 		$result = $this->CakeEmail->send('body');
1583 1583
 		$this->assertContains("Content-Type: text/plain\r\nContent-Transfer-Encoding: base64\r\nContent-ID: <a1b1c1>\r\nContent-Disposition: inline; filename=\"file2.txt\"", $result['message']);
1584 1584
 	}
@@ -1761,7 +1761,7 @@  discard block
 block discarded – undo
1761 1761
 	public function testRenderWithLayoutAndAttachment() {
1762 1762
 		$this->CakeEmail->emailFormat('html');
1763 1763
 		$this->CakeEmail->template('html', 'default');
1764
-		$this->CakeEmail->attachments(array(CAKE . 'basics.php'));
1764
+		$this->CakeEmail->attachments(array(CAKE.'basics.php'));
1765 1765
 		$result = $this->CakeEmail->render(array());
1766 1766
 		$this->assertNotEmpty($result);
1767 1767
 
@@ -1800,8 +1800,8 @@  discard block
 block discarded – undo
1800 1800
 
1801 1801
 		$result = $this->CakeEmail->send('This is the message');
1802 1802
 
1803
-		$this->assertTrue((bool)strpos($result['headers'], 'Message-ID: '));
1804
-		$this->assertTrue((bool)strpos($result['headers'], 'To: '));
1803
+		$this->assertTrue((bool) strpos($result['headers'], 'Message-ID: '));
1804
+		$this->assertTrue((bool) strpos($result['headers'], 'To: '));
1805 1805
 	}
1806 1806
 
1807 1807
 /**
@@ -1830,8 +1830,8 @@  discard block
 block discarded – undo
1830 1830
 
1831 1831
 		$result = $this->CakeEmail->send('This is the message');
1832 1832
 
1833
-		$this->assertTrue((bool)strpos($result['headers'], 'Message-ID: '));
1834
-		$this->assertTrue((bool)strpos($result['headers'], 'To: '));
1833
+		$this->assertTrue((bool) strpos($result['headers'], 'Message-ID: '));
1834
+		$this->assertTrue((bool) strpos($result['headers'], 'To: '));
1835 1835
 	}
1836 1836
 
1837 1837
 /**
@@ -1898,7 +1898,7 @@  discard block
 block discarded – undo
1898 1898
  * @return void
1899 1899
  */
1900 1900
 	public function testHeaderEncoding() {
1901
-		$this->skipIf(!function_exists('mb_convert_encoding'));
1901
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
1902 1902
 		$email = new CakeEmail(array('headerCharset' => 'iso-2022-jp-ms', 'transport' => 'Debug'));
1903 1903
 		$email->subject('あれ?もしかしての前と');
1904 1904
 		$headers = $email->getHeaders(array('subject'));
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
  * @return void
1917 1917
  */
1918 1918
 	public function testBodyEncoding() {
1919
-		$this->skipIf(!function_exists('mb_convert_encoding'));
1919
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
1920 1920
 		$email = new CakeEmail(array(
1921 1921
 			'charset' => 'iso-2022-jp',
1922 1922
 			'headerCharset' => 'iso-2022-jp-ms',
@@ -1939,7 +1939,7 @@  discard block
 block discarded – undo
1939 1939
  * @return void
1940 1940
  */
1941 1941
 	public function testBodyEncodingIso2022Jp() {
1942
-		$this->skipIf(!function_exists('mb_convert_encoding'));
1942
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
1943 1943
 		$email = new CakeEmail(array(
1944 1944
 			'charset' => 'iso-2022-jp',
1945 1945
 			'headerCharset' => 'iso-2022-jp',
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
  * @return void
1964 1964
  */
1965 1965
 	public function testBodyEncodingIso2022JpMs() {
1966
-		$this->skipIf(!function_exists('mb_convert_encoding'));
1966
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
1967 1967
 		$email = new CakeEmail(array(
1968 1968
 			'charset' => 'iso-2022-jp-ms',
1969 1969
 			'headerCharset' => 'iso-2022-jp-ms',
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
 	}
1983 1983
 
1984 1984
 	protected function _checkContentTransferEncoding($message, $charset) {
1985
-		$boundary = '--alt-' . $this->CakeEmail->getBoundary();
1985
+		$boundary = '--alt-'.$this->CakeEmail->getBoundary();
1986 1986
 		$result['text'] = false;
1987 1987
 		$result['html'] = false;
1988 1988
 		$length = count($message);
@@ -1990,14 +1990,14 @@  discard block
 block discarded – undo
1990 1990
 			if ($message[$i] == $boundary) {
1991 1991
 				$flag = false;
1992 1992
 				$type = '';
1993
-				while (!preg_match('/^$/', $message[$i])) {
1993
+				while ( ! preg_match('/^$/', $message[$i])) {
1994 1994
 					if (preg_match('/^Content-Type: text\/plain/', $message[$i])) {
1995 1995
 						$type = 'text';
1996 1996
 					}
1997 1997
 					if (preg_match('/^Content-Type: text\/html/', $message[$i])) {
1998 1998
 						$type = 'html';
1999 1999
 					}
2000
-					if ($message[$i] === 'Content-Transfer-Encoding: ' . $charset) {
2000
+					if ($message[$i] === 'Content-Transfer-Encoding: '.$charset) {
2001 2001
 						$flag = true;
2002 2002
 					}
2003 2003
 					++$i;
@@ -2014,7 +2014,7 @@  discard block
 block discarded – undo
2014 2014
  * @return void
2015 2015
  */
2016 2016
 	public function testEncode() {
2017
-		$this->skipIf(!function_exists('mb_convert_encoding'));
2017
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
2018 2018
 
2019 2019
 		$this->CakeEmail->headerCharset = 'ISO-2022-JP';
2020 2020
 		$result = $this->CakeEmail->encode('日本語');
@@ -2023,8 +2023,8 @@  discard block
 block discarded – undo
2023 2023
 
2024 2024
 		$this->CakeEmail->headerCharset = 'ISO-2022-JP';
2025 2025
 		$result = $this->CakeEmail->encode('長い長い長いSubjectの場合はfoldingするのが正しいんだけどいったいどうなるんだろう?');
2026
-		$expected = "=?ISO-2022-JP?B?GyRCRDkkJEQ5JCREOSQkGyhCU3ViamVjdBskQiROPmw5ZyRPGyhCZm9s?=\r\n" .
2027
-			" =?ISO-2022-JP?B?ZGluZxskQiQ5JGskTiQsQDUkNyQkJHMkQCQxJEkkJCRDJD8kJCRJGyhC?=\r\n" .
2026
+		$expected = "=?ISO-2022-JP?B?GyRCRDkkJEQ5JCREOSQkGyhCU3ViamVjdBskQiROPmw5ZyRPGyhCZm9s?=\r\n".
2027
+			" =?ISO-2022-JP?B?ZGluZxskQiQ5JGskTiQsQDUkNyQkJHMkQCQxJEkkJCRDJD8kJCRJGyhC?=\r\n".
2028 2028
 			" =?ISO-2022-JP?B?GyRCJCYkSiRrJHMkQCRtJCYhKRsoQg==?=";
2029 2029
 		$this->assertSame($expected, $result);
2030 2030
 	}
@@ -2069,7 +2069,7 @@  discard block
 block discarded – undo
2069 2069
  * @return void
2070 2070
  */
2071 2071
 	public function testCharsetsCompatible() {
2072
-		$this->skipIf(!function_exists('mb_convert_encoding'));
2072
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
2073 2073
 
2074 2074
 		$checkHeaders = array(
2075 2075
 			'from' => true,
@@ -2126,10 +2126,10 @@  discard block
 block discarded – undo
2126 2126
 	protected function _getEmailByOldStyleCharset($charset, $headerCharset) {
2127 2127
 		$email = new CakeEmail(array('transport' => 'Debug'));
2128 2128
 
2129
-		if (! empty($charset)) {
2129
+		if ( ! empty($charset)) {
2130 2130
 			$email->charset = $charset;
2131 2131
 		}
2132
-		if (! empty($headerCharset)) {
2132
+		if ( ! empty($headerCharset)) {
2133 2133
 			$email->headerCharset = $headerCharset;
2134 2134
 		}
2135 2135
 
@@ -2150,10 +2150,10 @@  discard block
 block discarded – undo
2150 2150
 	protected function _getEmailByNewStyleCharset($charset, $headerCharset) {
2151 2151
 		$email = new CakeEmail(array('transport' => 'Debug'));
2152 2152
 
2153
-		if (! empty($charset)) {
2153
+		if ( ! empty($charset)) {
2154 2154
 			$email->charset($charset);
2155 2155
 		}
2156
-		if (! empty($headerCharset)) {
2156
+		if ( ! empty($headerCharset)) {
2157 2157
 			$email->headerCharset($headerCharset);
2158 2158
 		}
2159 2159
 
@@ -2172,7 +2172,7 @@  discard block
 block discarded – undo
2172 2172
  * @return void
2173 2173
  */
2174 2174
 	public function testWrapLongLine() {
2175
-		$message = '<a href="http://cakephp.org">' . str_repeat('x', CakeEmail::LINE_LENGTH_MUST) . "</a>";
2175
+		$message = '<a href="http://cakephp.org">'.str_repeat('x', CakeEmail::LINE_LENGTH_MUST)."</a>";
2176 2176
 
2177 2177
 		$this->CakeEmail->reset();
2178 2178
 		$this->CakeEmail->transport('Debug');
@@ -2181,32 +2181,32 @@  discard block
 block discarded – undo
2181 2181
 		$this->CakeEmail->subject('Wordwrap Test');
2182 2182
 		$this->CakeEmail->config(array('empty'));
2183 2183
 		$result = $this->CakeEmail->send($message);
2184
-		$expected = "<a\r\n" . 'href="http://cakephp.org">' . str_repeat('x', CakeEmail::LINE_LENGTH_MUST - 26) . "\r\n" .
2185
-			str_repeat('x', 26) . "\r\n</a>\r\n\r\n";
2184
+		$expected = "<a\r\n".'href="http://cakephp.org">'.str_repeat('x', CakeEmail::LINE_LENGTH_MUST - 26)."\r\n".
2185
+			str_repeat('x', 26)."\r\n</a>\r\n\r\n";
2186 2186
 		$this->assertEquals($expected, $result['message']);
2187 2187
 		$this->assertLineLengths($result['message']);
2188 2188
 
2189 2189
 		$str1 = "a ";
2190 2190
 		$str2 = " b";
2191 2191
 		$length = strlen($str1) + strlen($str2);
2192
-		$message = $str1 . str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length - 1) . $str2;
2192
+		$message = $str1.str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length - 1).$str2;
2193 2193
 
2194 2194
 		$result = $this->CakeEmail->send($message);
2195 2195
 		$expected = "{$message}\r\n\r\n";
2196 2196
 		$this->assertEquals($expected, $result['message']);
2197 2197
 		$this->assertLineLengths($result['message']);
2198 2198
 
2199
-		$message = $str1 . str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length) . $str2;
2199
+		$message = $str1.str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length).$str2;
2200 2200
 
2201 2201
 		$result = $this->CakeEmail->send($message);
2202 2202
 		$expected = "{$message}\r\n\r\n";
2203 2203
 		$this->assertEquals($expected, $result['message']);
2204 2204
 		$this->assertLineLengths($result['message']);
2205 2205
 
2206
-		$message = $str1 . str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length + 1) . $str2;
2206
+		$message = $str1.str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length + 1).$str2;
2207 2207
 
2208 2208
 		$result = $this->CakeEmail->send($message);
2209
-		$expected = $str1 . str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length + 1) . sprintf("\r\n%s\r\n\r\n", trim($str2));
2209
+		$expected = $str1.str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length + 1).sprintf("\r\n%s\r\n\r\n", trim($str2));
2210 2210
 		$this->assertEquals($expected, $result['message']);
2211 2211
 		$this->assertLineLengths($result['message']);
2212 2212
 	}
@@ -2224,7 +2224,7 @@  discard block
 block discarded – undo
2224 2224
 </table>
2225 2225
 HTML;
2226 2226
 		$length = strlen($str);
2227
-		$message = $str . str_repeat('x', CakeEmail::LINE_LENGTH_MUST + 1);
2227
+		$message = $str.str_repeat('x', CakeEmail::LINE_LENGTH_MUST + 1);
2228 2228
 
2229 2229
 		$this->CakeEmail->reset();
2230 2230
 		$this->CakeEmail->transport('Debug');
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 	public function testWrapIncludeLessThanSign() {
2249 2249
 		$str = 'foo<bar';
2250 2250
 		$length = strlen($str);
2251
-		$message = $str . str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length + 1);
2251
+		$message = $str.str_repeat('x', CakeEmail::LINE_LENGTH_MUST - $length + 1);
2252 2252
 
2253 2253
 		$this->CakeEmail->reset();
2254 2254
 		$this->CakeEmail->transport('Debug');
@@ -2269,7 +2269,7 @@  discard block
 block discarded – undo
2269 2269
  * @return void
2270 2270
  */
2271 2271
 	public function testWrapForJapaneseEncoding() {
2272
-		$this->skipIf(!function_exists('mb_convert_encoding'));
2272
+		$this->skipIf( ! function_exists('mb_convert_encoding'));
2273 2273
 
2274 2274
 		$message = mb_convert_encoding('受け付けました', 'iso-2022-jp', 'UTF-8');
2275 2275
 
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 /**
30 30
  * Helper to change the socket
31 31
  *
32
- * @param object $socket
32
+ * @param CakeSocket $socket
33 33
  * @return void
34 34
  */
35 35
 	public function setSocket(CakeSocket $socket) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  * @return mixed
63 63
  */
64 64
 	public function __call($method, $args) {
65
-		$method = '_' . $method;
65
+		$method = '_'.$method;
66 66
 		return $this->$method();
67 67
 	}
68 68
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 		$data .= "To: CakePHP <[email protected]>\r\n";
312 312
 		$data .= "Cc: Mark Story <[email protected]>, Juan Basso <[email protected]>\r\n";
313 313
 		$data .= "X-Mailer: CakePHP Email\r\n";
314
-		$data .= "Date: " . $date . "\r\n";
314
+		$data .= "Date: ".$date."\r\n";
315 315
 		$data .= "Message-ID: <4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>\r\n";
316 316
 		$data .= "Subject: Testing SMTP\r\n";
317 317
 		$data .= "MIME-Version: 1.0\r\n";
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Network/Http/HttpSocketTest.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
  * Convenience method for testing protected method
84 84
  *
85 85
  * @param string|array $uri URI (see {@link _parseUri()})
86
- * @return array Current configuration settings
86
+ * @return boolean Current configuration settings
87 87
  */
88 88
 	public function configUri($uri = null) {
89 89
 		return parent::_configUri($uri);
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * @return void
35 35
  */
36 36
 	public static function authentication(HttpSocket $http, &$authInfo) {
37
-		$http->request['header']['Authorization'] = 'Test ' . $authInfo['user'] . '.' . $authInfo['pass'];
37
+		$http->request['header']['Authorization'] = 'Test '.$authInfo['user'].'.'.$authInfo['pass'];
38 38
 	}
39 39
 
40 40
 /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  * @return void
46 46
  */
47 47
 	public static function proxyAuthentication(HttpSocket $http, &$proxyInfo) {
48
-		$http->request['header']['Proxy-Authorization'] = 'Test ' . $proxyInfo['user'] . '.' . $proxyInfo['pass'];
48
+		$http->request['header']['Proxy-Authorization'] = 'Test '.$proxyInfo['user'].'.'.$proxyInfo['pass'];
49 49
 	}
50 50
 
51 51
 }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				'allow_self_signed' => false,
321 321
 				'verify_depth' => 5,
322 322
 				'CN_match' => 'www.cakephp.org',
323
-				'cafile' => CAKE . 'Config' . DS . 'cacert.pem'
323
+				'cafile' => CAKE.'Config'.DS.'cacert.pem'
324 324
 			)
325 325
 		);
326 326
 
@@ -556,10 +556,10 @@  discard block
 block discarded – undo
556 556
 			$this->Socket->request($test['request']);
557 557
 
558 558
 			$raw = $expectation['request']['raw'];
559
-			$expectation['request']['raw'] = $expectation['request']['line'] . $expectation['request']['header'] . "\r\n" . $raw;
559
+			$expectation['request']['raw'] = $expectation['request']['line'].$expectation['request']['header']."\r\n".$raw;
560 560
 
561 561
 			$r = array('config' => $this->Socket->config, 'request' => $this->Socket->request);
562
-			$this->assertEquals($r, $expectation, 'Failed test #' . $i . ' ');
562
+			$this->assertEquals($r, $expectation, 'Failed test #'.$i.' ');
563 563
 			$expectation['request']['raw'] = $raw;
564 564
 		}
565 565
 
@@ -631,13 +631,13 @@  discard block
 block discarded – undo
631 631
 		$request = array('uri' => 'htpp://www.cakephp.org/');
632 632
 		$number = mt_rand(0, 9999999);
633 633
 		$this->Socket->expects($this->any())->method('connect')->will($this->returnValue(true));
634
-		$serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n<h1>Hello, your lucky number is " . $number . "</h1>";
634
+		$serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\n<h1>Hello, your lucky number is ".$number."</h1>";
635 635
 		$this->Socket->expects($this->at(0))->method('write')
636 636
 			->with("GET / HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n");
637 637
 		$this->Socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
638 638
 		$this->Socket->expects($this->at(1))->method('read')->will($this->returnValue($serverResponse));
639
-		$response = (string)$this->Socket->request($request);
640
-		$this->assertEquals($response, "<h1>Hello, your lucky number is " . $number . "</h1>");
639
+		$response = (string) $this->Socket->request($request);
640
+		$this->assertEquals($response, "<h1>Hello, your lucky number is ".$number."</h1>");
641 641
 	}
642 642
 
643 643
 /**
@@ -702,21 +702,21 @@  discard block
 block discarded – undo
702 702
 		$this->Socket->expects($this->at(4))->method('read')->will($this->returnValue($serverResponse));
703 703
 		$this->Socket->connected = true;
704 704
 
705
-		$f = fopen(TMP . 'download.txt', 'w');
706
-		if (!$f) {
705
+		$f = fopen(TMP.'download.txt', 'w');
706
+		if ( ! $f) {
707 707
 			$this->markTestSkipped('Can not write in TMP directory.');
708 708
 		}
709 709
 
710 710
 		$this->Socket->setContentResource($f);
711
-		$result = (string)$this->Socket->request('http://www.cakephp.org/');
711
+		$result = (string) $this->Socket->request('http://www.cakephp.org/');
712 712
 		$this->assertEquals('', $result);
713 713
 		$this->assertEquals('CakeHttp Server', $this->Socket->response['header']['Server']);
714 714
 		fclose($f);
715
-		$this->assertEquals(file_get_contents(TMP . 'download.txt'), '<h1>This is a test!</h1>');
716
-		unlink(TMP . 'download.txt');
715
+		$this->assertEquals(file_get_contents(TMP.'download.txt'), '<h1>This is a test!</h1>');
716
+		unlink(TMP.'download.txt');
717 717
 
718 718
 		$this->Socket->setContentResource(false);
719
-		$result = (string)$this->Socket->request('http://www.cakephp.org/');
719
+		$result = (string) $this->Socket->request('http://www.cakephp.org/');
720 720
 		$this->assertEquals('<h1>This is a test!</h1>', $result);
721 721
 	}
722 722
 
@@ -1654,11 +1654,11 @@  discard block
 block discarded – undo
1654 1654
 
1655 1655
 		$escape = $this->Socket->tokenEscapeChars(false);
1656 1656
 		foreach ($escape as $char) {
1657
-			$token = 'My-special-' . $char . '-Token';
1657
+			$token = 'My-special-'.$char.'-Token';
1658 1658
 			$escapedToken = $this->Socket->escapeToken($token);
1659
-			$expectedToken = 'My-special-"' . $char . '"-Token';
1659
+			$expectedToken = 'My-special-"'.$char.'"-Token';
1660 1660
 
1661
-			$this->assertEquals($expectedToken, $escapedToken, 'Test token escaping for ASCII ' . ord($char));
1661
+			$this->assertEquals($expectedToken, $escapedToken, 'Test token escaping for ASCII '.ord($char));
1662 1662
 		}
1663 1663
 
1664 1664
 		$token = 'Extreme-:Token-	-"@-test';
@@ -1742,7 +1742,7 @@  discard block
 block discarded – undo
1742 1742
  * @return void
1743 1743
  */
1744 1744
 	public function testVerifyPeer() {
1745
-		$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
1745
+		$this->skipIf( ! extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
1746 1746
 		$socket = new HttpSocket();
1747 1747
 		try {
1748 1748
 			$socket->get('https://typography.com');
@@ -1777,7 +1777,7 @@  discard block
 block discarded – undo
1777 1777
  */
1778 1778
 	public function testResponseStatusParsing($status, $msg = '') {
1779 1779
 		$this->Socket->connected = true;
1780
-		$serverResponse = $status . "\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\n\r\n<h1>This is a test!</h1>";
1780
+		$serverResponse = $status."\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\n\r\n<h1>This is a test!</h1>";
1781 1781
 		$this->Socket->expects($this->at(1))->method('read')->will($this->returnValue($serverResponse));
1782 1782
 		$this->Socket->expects($this->at(2))->method('read')->will($this->returnValue(false));
1783 1783
 
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Routing/DispatcherTest.php 2 patches
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  * @param Controller $controller
58 58
  * @param CakeRequest $request
59 59
  * @param CakeResponse $response
60
- * @return void
60
+ * @return CakeResponse
61 61
  */
62 62
 	protected function _invoke(Controller $controller, CakeRequest $request, CakeResponse $response) {
63 63
 		$this->controller = $controller;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 /**
131 131
  * index method
132 132
  *
133
- * @return void
133
+ * @return boolean
134 134
  */
135 135
 	public function index() {
136 136
 		return true;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 /**
140 140
  * add method
141 141
  *
142
- * @return void
142
+ * @return boolean
143 143
  */
144 144
 	public function add() {
145 145
 		return true;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
  * display method
176 176
  *
177 177
  * @param string $page
178
- * @return void
178
+ * @return string|null
179 179
  */
180 180
 	public function display($page = null) {
181 181
 		return $page;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 /**
185 185
  * index method
186 186
  *
187
- * @return void
187
+ * @return boolean
188 188
  */
189 189
 	public function index() {
190 190
 		return true;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
  * display method
230 230
  *
231 231
  * @param string $page
232
- * @return void
232
+ * @return string|null
233 233
  */
234 234
 	public function display($page = null) {
235 235
 		return $page;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 /**
239 239
  * index method
240 240
  *
241
- * @return void
241
+ * @return boolean
242 242
  */
243 243
 	public function index() {
244 244
 		return true;
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 /**
264 264
  * admin_index method
265 265
  *
266
- * @return void
266
+ * @return boolean
267 267
  */
268 268
 	public function admin_index() {
269 269
 		return true;
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 /**
273 273
  * camelCased method
274 274
  *
275
- * @return void
275
+ * @return boolean
276 276
  */
277 277
 	public function camelCased() {
278 278
 		return true;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 /**
306 306
  * admin_index method
307 307
  *
308
- * @return void
308
+ * @return boolean
309 309
  */
310 310
 	public function admin_index() {
311 311
 		return true;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 /**
315 315
  * fake index method.
316 316
  *
317
- * @return void
317
+ * @return boolean
318 318
  */
319 319
 	public function index() {
320 320
 		return true;
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 /**
361 361
  * index method
362 362
  *
363
- * @return void
363
+ * @return boolean
364 364
  */
365 365
 	public function index() {
366 366
 		return true;
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 /**
370 370
  * change method
371 371
  *
372
- * @return void
372
+ * @return boolean
373 373
  */
374 374
 	public function change() {
375 375
 		return true;
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 /**
491 491
  * index method
492 492
  *
493
- * @return void
493
+ * @return boolean
494 494
  */
495 495
 	public function index() {
496 496
 		return true;
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
 App::uses('Dispatcher', 'Routing');
20 20
 
21
-if (!class_exists('AppController', false)) {
22
-	require_once CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS . 'AppController.php';
23
-} elseif (!defined('APP_CONTROLLER_EXISTS')) {
21
+if ( ! class_exists('AppController', false)) {
22
+	require_once CAKE.'Test'.DS.'test_app'.DS.'Controller'.DS.'AppController.php';
23
+} elseif ( ! defined('APP_CONTROLLER_EXISTS')) {
24 24
 	define('APP_CONTROLLER_EXISTS', true);
25 25
 }
26 26
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 class DispatcherMockCakeResponse extends CakeResponse {
33 33
 
34 34
 	protected function _sendHeader($name, $value = null) {
35
-		return $name . ' ' . $value;
35
+		return $name.' '.$value;
36 36
 	}
37 37
 
38 38
 }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
  * @return CakeResponse
206 206
  */
207 207
 	public function sendfile() {
208
-		$this->response->file(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS . 'css' . DS . 'test_asset.css');
208
+		$this->response->file(CAKE.'Test'.DS.'test_app'.DS.'Vendor'.DS.'css'.DS.'test_asset.css');
209 209
 		return $this->response;
210 210
 	}
211 211
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 		$this->assertSame($request['pass'][0], 'params1');
568 568
 		$this->assertSame($request['pass'][1], 'params2');
569 569
 		$this->assertSame($request['pass'][2], 'params3');
570
-		$this->assertFalse(!empty($request['form']));
570
+		$this->assertFalse( ! empty($request['form']));
571 571
 	}
572 572
 
573 573
 /**
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
  */
756 756
 	public function testDispatchBasic() {
757 757
 		App::build(array(
758
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
758
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS)
759 759
 		));
760 760
 		$Dispatcher = new TestDispatcher();
761 761
 		Configure::write('App.baseUrl', '/index.php');
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
 		unset($Dispatcher);
788 788
 
789
-		require CAKE . 'Config' . DS . 'routes.php';
789
+		require CAKE.'Config'.DS.'routes.php';
790 790
 		$Dispatcher = new TestDispatcher();
791 791
 		Configure::write('App.baseUrl', '/timesheets/index.php');
792 792
 
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 			'controller' => 'some_pages', 'action' => 'display'
919 919
 		);
920 920
 		foreach ($expected as $key => $value) {
921
-			$this->assertEquals($value, $url[$key], 'Value mismatch ' . $key . ' %');
921
+			$this->assertEquals($value, $url[$key], 'Value mismatch '.$key.' %');
922 922
 		}
923 923
 
924 924
 		$this->assertSame($Dispatcher->controller->plugin, 'MyPlugin');
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 		$this->assertEquals(array('param' => 'value', 'param2' => 'value2'), $Dispatcher->controller->params['named']);
989 989
 
990 990
 		Router::reload();
991
-		require CAKE . 'Config' . DS . 'routes.php';
991
+		require CAKE.'Config'.DS.'routes.php';
992 992
 		$Dispatcher = new TestDispatcher();
993 993
 		$Dispatcher->base = false;
994 994
 
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 		Configure::write('Routing.prefixes', array('admin'));
1011 1011
 
1012 1012
 		Router::reload();
1013
-		require CAKE . 'Config' . DS . 'routes.php';
1013
+		require CAKE.'Config'.DS.'routes.php';
1014 1014
 		$Dispatcher = new TestDispatcher();
1015 1015
 
1016 1016
 		$url = new CakeRequest('admin/my_plugin/my_plugin/add/5/param:value/param2:value2');
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 		Configure::write('Routing.prefixes', array('admin'));
1034 1034
 		CakePlugin::load('ArticlesTest', array('path' => '/fake/path'));
1035 1035
 		Router::reload();
1036
-		require CAKE . 'Config' . DS . 'routes.php';
1036
+		require CAKE.'Config'.DS.'routes.php';
1037 1037
 
1038 1038
 		$Dispatcher = new TestDispatcher();
1039 1039
 
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 			'return' => 1
1054 1054
 		);
1055 1055
 		foreach ($expected as $key => $value) {
1056
-			$this->assertEquals($expected[$key], $Dispatcher->controller->request[$key], 'Value mismatch ' . $key);
1056
+			$this->assertEquals($expected[$key], $Dispatcher->controller->request[$key], 'Value mismatch '.$key);
1057 1057
 		}
1058 1058
 	}
1059 1059
 
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
 
1093 1093
 		Router::reload();
1094 1094
 		App::build(array(
1095
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
1095
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS)
1096 1096
 		), App::RESET);
1097 1097
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
1098 1098
 
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 	public function testTestPluginDispatch() {
1169 1169
 		$Dispatcher = new TestDispatcher();
1170 1170
 		App::build(array(
1171
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
1171
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS)
1172 1172
 		), App::RESET);
1173 1173
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
1174 1174
 		Router::reload();
@@ -1195,8 +1195,8 @@  discard block
 block discarded – undo
1195 1195
  */
1196 1196
 	public function testDispatcherFilterSubscriber() {
1197 1197
 		App::build(array(
1198
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
1199
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
1198
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS),
1199
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS)
1200 1200
 		), App::RESET);
1201 1201
 
1202 1202
 		CakePlugin::load('TestPlugin');
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
  */
1236 1236
 	public function testDispatcherFilterSuscriberMissing() {
1237 1237
 		App::build(array(
1238
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
1238
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS)
1239 1239
 		), App::RESET);
1240 1240
 
1241 1241
 		CakePlugin::load('TestPlugin');
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
  */
1256 1256
 	public function testDispatcherFilterCallable() {
1257 1257
 		App::build(array(
1258
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
1258
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS)
1259 1259
 		), App::RESET);
1260 1260
 
1261 1261
 		$dispatcher = new TestDispatcher();
@@ -1350,9 +1350,9 @@  discard block
 block discarded – undo
1350 1350
 		Router::reload();
1351 1351
 
1352 1352
 		App::build(array(
1353
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
1354
-			'Vendor' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS),
1355
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
1353
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS),
1354
+			'Vendor' => array(CAKE.'Test'.DS.'test_app'.DS.'Vendor'.DS),
1355
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS)
1356 1356
 		));
1357 1357
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
1358 1358
 		Configure::write('Dispatcher.filters', array('AssetDispatcher'));
@@ -1469,9 +1469,9 @@  discard block
 block discarded – undo
1469 1469
 		Router::reload();
1470 1470
 
1471 1471
 		App::build(array(
1472
-			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
1473
-			'Vendor' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor' . DS),
1474
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
1472
+			'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS),
1473
+			'Vendor' => array(CAKE.'Test'.DS.'test_app'.DS.'Vendor'.DS),
1474
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS)
1475 1475
 		));
1476 1476
 		CakePlugin::load(array('TestPlugin', 'PluginJs'));
1477 1477
 		Configure::write('Dispatcher.filters', array('AssetDispatcher'));
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
 		$Dispatcher->dispatch(new CakeRequest($url), $response);
1483 1483
 		$result = ob_get_clean();
1484 1484
 
1485
-		$path = CAKE . 'Test' . DS . 'test_app' . DS . str_replace('/', DS, $file);
1485
+		$path = CAKE.'Test'.DS.'test_app'.DS.str_replace('/', DS, $file);
1486 1486
 		$file = file_get_contents($path);
1487 1487
 		$this->assertEquals($file, $result);
1488 1488
 
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 		Router::connect('/:controller/:action/*');
1552 1552
 
1553 1553
 		App::build(array(
1554
-			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
1554
+			'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS),
1555 1555
 		), App::RESET);
1556 1556
 
1557 1557
 		$dispatcher = new TestDispatcher();
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
 		$dispatcher->parseParams($event);
1594 1594
 		$expected = array('pass' => array(), 'named' => array(), 'plugin' => null, 'controller' => 'posts', 'action' => 'add', '[method]' => 'POST');
1595 1595
 		foreach ($expected as $key => $value) {
1596
-			$this->assertEquals($value, $request[$key], 'Value mismatch for ' . $key . ' %s');
1596
+			$this->assertEquals($value, $request[$key], 'Value mismatch for '.$key.' %s');
1597 1597
 		}
1598 1598
 
1599 1599
 		$_SERVER['REQUEST_METHOD'] = 'GET';
@@ -1612,7 +1612,7 @@  discard block
 block discarded – undo
1612 1612
 			'[method]' => 'PUT'
1613 1613
 		);
1614 1614
 		foreach ($expected as $key => $value) {
1615
-			$this->assertEquals($value, $request[$key], 'Value mismatch for ' . $key . ' %s');
1615
+			$this->assertEquals($value, $request[$key], 'Value mismatch for '.$key.' %s');
1616 1616
 		}
1617 1617
 
1618 1618
 		unset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
 		$dispatcher->parseParams($event);
1624 1624
 		$expected = array('pass' => array('5'), 'named' => array(), 'id' => '5', 'plugin' => null, 'controller' => 'posts', 'action' => 'view', '[method]' => 'GET');
1625 1625
 		foreach ($expected as $key => $value) {
1626
-			$this->assertEquals($value, $request[$key], 'Value mismatch for ' . $key . ' %s');
1626
+			$this->assertEquals($value, $request[$key], 'Value mismatch for '.$key.' %s');
1627 1627
 		}
1628 1628
 
1629 1629
 		$_POST['_method'] = 'PUT';
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 		$dispatcher->parseParams($event);
1634 1634
 		$expected = array('pass' => array('5'), 'named' => array(), 'id' => '5', 'plugin' => null, 'controller' => 'posts', 'action' => 'edit', '[method]' => 'PUT');
1635 1635
 		foreach ($expected as $key => $value) {
1636
-			$this->assertEquals($value, $request[$key], 'Value mismatch for ' . $key . ' %s');
1636
+			$this->assertEquals($value, $request[$key], 'Value mismatch for '.$key.' %s');
1637 1637
 		}
1638 1638
 
1639 1639
 		$_POST['_method'] = 'POST';
@@ -1649,7 +1649,7 @@  discard block
 block discarded – undo
1649 1649
 			'[method]' => 'POST', 'data' => array('extra' => 'data', 'Post' => array('title' => 'New Post')),
1650 1650
 		);
1651 1651
 		foreach ($expected as $key => $value) {
1652
-			$this->assertEquals($value, $request[$key], 'Value mismatch for ' . $key . ' %s');
1652
+			$this->assertEquals($value, $request[$key], 'Value mismatch for '.$key.' %s');
1653 1653
 		}
1654 1654
 
1655 1655
 		unset($_POST['_method']);
@@ -1668,10 +1668,10 @@  discard block
 block discarded – undo
1668 1668
 		}
1669 1669
 		$path = strtolower(Inflector::slug($path));
1670 1670
 
1671
-		$filename = CACHE . 'views' . DS . $path . '.php';
1671
+		$filename = CACHE.'views'.DS.$path.'.php';
1672 1672
 
1673
-		if (!file_exists($filename)) {
1674
-			$filename = CACHE . 'views' . DS . $path . '_index.php';
1673
+		if ( ! file_exists($filename)) {
1674
+			$filename = CACHE.'views'.DS.$path.'_index.php';
1675 1675
 		}
1676 1676
 		return $filename;
1677 1677
 	}
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Utility/CakeTimeTest.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,6 @@
 block discarded – undo
58 58
 /**
59 59
  * Restored the original system timezone
60 60
  *
61
- * @param string $timezoneIdentifier Timezone string
62 61
  * @return void
63 62
  */
64 63
 	protected function _restoreSystemTimezone() {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			array(
163 163
 				'+2 months +2 days',
164 164
 				'2 months, 2 days',
165
-				'on ' . date('j/n/y', strtotime('+2 months +2 days'))
165
+				'on '.date('j/n/y', strtotime('+2 months +2 days'))
166 166
 			),
167 167
 			array(
168 168
 				'+2 months +12 days',
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			strtotime('+4 months +2 weeks +3 days'),
203 203
 			array('absoluteString' => 'exactly on %s', 'accuracy' => array('year' => 'year'), 'end' => '+2 months')
204 204
 		);
205
-		$expected = 'exactly on ' . date('j/n/y', strtotime('+4 months +2 weeks +3 days'));
205
+		$expected = 'exactly on '.date('j/n/y', strtotime('+4 months +2 weeks +3 days'));
206 206
 		$this->assertEquals($expected, $result);
207 207
 	}
208 208
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 			strtotime('+2 months +2 days'),
285 285
 			array('end' => '1 month', 'format' => 'Y-m-d')
286 286
 		);
287
-		$this->assertEquals('on ' . date('Y-m-d', strtotime('+2 months +2 days')), $result);
287
+		$this->assertEquals('on '.date('Y-m-d', strtotime('+2 months +2 days')), $result);
288 288
 	}
289 289
 
290 290
 /**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 			strtotime('-2 months -2 days'),
310 310
 			array('end' => '1 month', 'format' => 'Y-m-d')
311 311
 		);
312
-		$this->assertEquals('on ' . date('Y-m-d', strtotime('-2 months -2 days')), $result);
312
+		$this->assertEquals('on '.date('Y-m-d', strtotime('-2 months -2 days')), $result);
313 313
 
314 314
 		$result = $this->Time->timeAgoInWords(
315 315
 			strtotime('-2 years -5 months -2 days'),
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
 		$time = strtotime('-3 years -12 months');
327 327
 		$result = $this->Time->timeAgoInWords($time);
328
-		$expected = 'on ' . date('j/n/y', $time);
328
+		$expected = 'on '.date('j/n/y', $time);
329 329
 		$this->assertEquals($expected, $result);
330 330
 
331 331
 		$result = $this->Time->timeAgoInWords(
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			$timestamp,
340 340
 			array('accuracy' => array('year' => 'year'))
341 341
 		);
342
-		$expected = 'on ' . date('j/n/y', $timestamp);
342
+		$expected = 'on '.date('j/n/y', $timestamp);
343 343
 		$this->assertEquals($expected, $result);
344 344
 
345 345
 		$result = $this->Time->timeAgoInWords(
@@ -409,16 +409,16 @@  discard block
 block discarded – undo
409 409
  */
410 410
 	public function testNiceShort() {
411 411
 		$time = time();
412
-		$this->assertEquals('Today, ' . date('H:i', $time), $this->Time->niceShort($time));
412
+		$this->assertEquals('Today, '.date('H:i', $time), $this->Time->niceShort($time));
413 413
 
414 414
 		$time = time() - DAY;
415
-		$this->assertEquals('Yesterday, ' . date('H:i', $time), $this->Time->niceShort($time));
415
+		$this->assertEquals('Yesterday, '.date('H:i', $time), $this->Time->niceShort($time));
416 416
 
417 417
 		$time = time() + DAY;
418
-		$this->assertEquals('Tomorrow, ' . date('H:i', $time), $this->Time->niceShort($time));
418
+		$this->assertEquals('Tomorrow, '.date('H:i', $time), $this->Time->niceShort($time));
419 419
 
420 420
 		$time = strtotime('+6 days');
421
-		$this->assertEquals('On ' . date('l F d, H:i', $time), $this->Time->niceShort($time));
421
+		$this->assertEquals('On '.date('l F d, H:i', $time), $this->Time->niceShort($time));
422 422
 
423 423
 		$time = strtotime('-6 days');
424 424
 		$this->assertEquals(date('l F d, H:i', $time), $this->Time->niceShort($time));
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 		$begin = time();
445 445
 		$end = time() + DAY;
446 446
 		$field = 'my_field';
447
-		$expected = '(my_field >= \'' . date('Y-m-d', $begin) . ' 00:00:00\') AND (my_field <= \'' . date('Y-m-d', $end) . ' 23:59:59\')';
447
+		$expected = '(my_field >= \''.date('Y-m-d', $begin).' 00:00:00\') AND (my_field <= \''.date('Y-m-d', $end).' 23:59:59\')';
448 448
 		$this->assertEquals($expected, $this->Time->daysAsSql($begin, $end, $field));
449 449
 	}
450 450
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	public function testDayAsSql() {
457 457
 		$time = time();
458 458
 		$field = 'my_field';
459
-		$expected = '(my_field >= \'' . date('Y-m-d', $time) . ' 00:00:00\') AND (my_field <= \'' . date('Y-m-d', $time) . ' 23:59:59\')';
459
+		$expected = '(my_field >= \''.date('Y-m-d', $time).' 00:00:00\') AND (my_field <= \''.date('Y-m-d', $time).' 23:59:59\')';
460 460
 		$this->assertEquals($expected, $this->Time->dayAsSql($time, $field));
461 461
 	}
462 462
 
@@ -698,10 +698,10 @@  discard block
 block discarded – undo
698 698
 		$days = $map[date('D')];
699 699
 
700 700
 		for ($day = $days[0] + 1; $day < $days[1]; $day++) {
701
-			$this->assertTrue($this->Time->isThisWeek(($day > 0 ? '+' : '') . $day . ' days'));
701
+			$this->assertTrue($this->Time->isThisWeek(($day > 0 ? '+' : '').$day.' days'));
702 702
 		}
703
-		$this->assertFalse($this->Time->isThisWeek($days[0] . ' days'));
704
-		$this->assertFalse($this->Time->isThisWeek('+' . $days[1] . ' days'));
703
+		$this->assertFalse($this->Time->isThisWeek($days[0].' days'));
704
+		$this->assertFalse($this->Time->isThisWeek('+'.$days[1].' days'));
705 705
 	}
706 706
 
707 707
 /**
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
  */
968 968
 	public function testConvertSpecifiers() {
969 969
 		App::build(array(
970
-			'Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
970
+			'Locale' => array(CAKE.'Test'.DS.'test_app'.DS.'Locale'.DS)
971 971
 		), App::RESET);
972 972
 		Configure::write('Config.language', 'time_test');
973 973
 		$time = strtotime('Thu Jan 14 11:43:39 2010');
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
  */
1075 1075
 	public function testI18nFormat() {
1076 1076
 		App::build(array(
1077
-			'Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
1077
+			'Locale' => array(CAKE.'Test'.DS.'test_app'.DS.'Locale'.DS)
1078 1078
 		), App::RESET);
1079 1079
 		Configure::write('Config.language', 'time_test');
1080 1080
 
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 		$this->assertEquals($expected, $result);
1086 1086
 
1087 1087
 		$result = $this->Time->i18nFormat($time, '%c');
1088
-		$expected = 'jue 14 ene 2010 13:59:28 ' . utf8_encode(strftime('%Z', $time));
1088
+		$expected = 'jue 14 ene 2010 13:59:28 '.utf8_encode(strftime('%Z', $time));
1089 1089
 		$this->assertEquals($expected, $result);
1090 1090
 
1091 1091
 		$result = $this->Time->i18nFormat($time, 'Time is %r, and date is %x');
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
 		$this->assertEquals($expected, $result);
1100 1100
 
1101 1101
 		$result = $this->Time->i18nFormat($time, '%c');
1102
-		$expected = 'mié 13 ene 2010 13:59:28 ' . utf8_encode(strftime('%Z', $time));
1102
+		$expected = 'mié 13 ene 2010 13:59:28 '.utf8_encode(strftime('%Z', $time));
1103 1103
 		$this->assertEquals($expected, $result);
1104 1104
 
1105 1105
 		$result = $this->Time->i18nFormat($time, 'Time is %r, and date is %x');
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
 		$this->assertTrue(isset($return['America/Argentina/Buenos_Aires']));
1146 1146
 		$this->assertTrue(isset($return['Pacific/Tahiti']));
1147 1147
 
1148
-		if (!$this->skipIf(version_compare(PHP_VERSION, '5.3.0', '<'))) {
1148
+		if ( ! $this->skipIf(version_compare(PHP_VERSION, '5.3.0', '<'))) {
1149 1149
 			$return = CakeTime::listTimezones(DateTimeZone::ASIA);
1150 1150
 			$this->assertTrue(isset($return['Asia']['Asia/Bangkok']));
1151 1151
 			$this->assertFalse(isset($return['Pacific']));
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Utility/DebuggerTest.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@
 block discarded – undo
275 275
 /**
276 276
  * Test method for testing addFormat with callbacks.
277 277
  *
278
- * @return void
278
+ * @return string
279 279
  */
280 280
 	public function customFormat($error, $strings) {
281 281
 		return $error['error'] . ': I eated an error ' . $error['file'];
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 			'pre' => array('class' => 'cake-error'),
143 143
 			'a' => array(
144 144
 				'href' => "javascript:void(0);",
145
-				'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " .
146
-					"\(document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display == 'none'" .
145
+				'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = ".
146
+					"\(document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display == 'none'".
147 147
 					" \? '' \: 'none'\);/"
148 148
 			),
149 149
 			'b' => array(), 'Notice', '/b', ' (8)',
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
 		$this->_restoreError = true;
166 166
 
167 167
 		Debugger::output('js', array(
168
-			'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}' .
168
+			'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}'.
169 169
 				'&line={:line}">{:path}</a>, line {:line}'
170 170
 		));
171 171
 		$result = Debugger::trace();
172
-		$this->assertRegExp('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);
172
+		$this->assertRegExp('/'.preg_quote('txmt://open?url=file://', '/').'(\/|[A-Z]:\\\\)'.'/', $result);
173 173
 
174 174
 		Debugger::output('xml', array(
175
-			'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>' .
175
+			'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>'.
176 176
 				'{:description}</error>',
177 177
 			'context' => "<context>{:context}</context>",
178 178
 			'trace' => "<stack>{:trace}</stack>",
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 			'error' => array(),
188 188
 			'code' => array(), '8', '/code',
189 189
 			'file' => array(), 'preg:/[^<]+/', '/file',
190
-			'line' => array(), '' . (intval(__LINE__) - 7), '/line',
190
+			'line' => array(), ''.(intval(__LINE__) - 7), '/line',
191 191
 			'preg:/Undefined variable:\s+foo/',
192 192
 			'/error'
193 193
 		);
@@ -224,16 +224,16 @@  discard block
 block discarded – undo
224 224
 		$this->_restoreError = true;
225 225
 
226 226
 		Debugger::addFormat('js', array(
227
-			'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}' .
227
+			'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}'.
228 228
 				'&line={:line}">{:path}</a>, line {:line}'
229 229
 		));
230 230
 		Debugger::outputAs('js');
231 231
 
232 232
 		$result = Debugger::trace();
233
-		$this->assertRegExp('/' . preg_quote('txmt://open?url=file://', '/') . '(\/|[A-Z]:\\\\)' . '/', $result);
233
+		$this->assertRegExp('/'.preg_quote('txmt://open?url=file://', '/').'(\/|[A-Z]:\\\\)'.'/', $result);
234 234
 
235 235
 		Debugger::addFormat('xml', array(
236
-			'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>' .
236
+			'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>'.
237 237
 				'{:description}</error>',
238 238
 		));
239 239
 		Debugger::outputAs('xml');
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			'<error',
247 247
 			'<code', '8', '/code',
248 248
 			'<file', 'preg:/[^<]+/', '/file',
249
-			'<line', '' . (intval(__LINE__) - 7), '/line',
249
+			'<line', ''.(intval(__LINE__) - 7), '/line',
250 250
 			'preg:/Undefined variable:\s+foo/',
251 251
 			'/error'
252 252
 		);
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
  * @return void
279 279
  */
280 280
 	public function customFormat($error, $strings) {
281
-		return $error['error'] . ': I eated an error ' . $error['file'];
281
+		return $error['error'].': I eated an error '.$error['file'];
282 282
 	}
283 283
 
284 284
 /**
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
  * @return void
288 288
  */
289 289
 	public function testTrimPath() {
290
-		$this->assertEquals('APP' . DS, Debugger::trimPath(APP));
290
+		$this->assertEquals('APP'.DS, Debugger::trimPath(APP));
291 291
 		$this->assertEquals('CORE', Debugger::trimPath(CAKE_CORE_INCLUDE_PATH));
292 292
 		$this->assertEquals('ROOT', Debugger::trimPath(ROOT));
293
-		$this->assertEquals('CORE' . DS . 'Cake' . DS, Debugger::trimPath(CAKE));
293
+		$this->assertEquals('CORE'.DS.'Cake'.DS, Debugger::trimPath(CAKE));
294 294
 		$this->assertEquals('Some/Other/Path', Debugger::trimPath('Some/Other/Path'));
295 295
 	}
296 296
 
@@ -450,20 +450,20 @@  discard block
 block discarded – undo
450 450
  * @return void
451 451
  */
452 452
 	public function testLog() {
453
-		if (file_exists(LOGS . 'debug.log')) {
454
-			unlink(LOGS . 'debug.log');
453
+		if (file_exists(LOGS.'debug.log')) {
454
+			unlink(LOGS.'debug.log');
455 455
 		}
456
-		CakeLog::config('file', array('engine' => 'File', 'path' => TMP . 'logs' . DS));
456
+		CakeLog::config('file', array('engine' => 'File', 'path' => TMP.'logs'.DS));
457 457
 
458 458
 		Debugger::log('cool');
459
-		$result = file_get_contents(LOGS . 'debug.log');
459
+		$result = file_get_contents(LOGS.'debug.log');
460 460
 		$this->assertRegExp('/DebuggerTest\:\:testLog/i', $result);
461 461
 		$this->assertRegExp("/'cool'/", $result);
462 462
 
463
-		unlink(LOGS . 'debug.log');
463
+		unlink(LOGS.'debug.log');
464 464
 
465 465
 		Debugger::log(array('whatever', 'here'));
466
-		$result = file_get_contents(LOGS . 'debug.log');
466
+		$result = file_get_contents(LOGS.'debug.log');
467 467
 		$this->assertRegExp('/DebuggerTest\:\:testLog/i', $result);
468 468
 		$this->assertRegExp('/\[main\]/', $result);
469 469
 		$this->assertRegExp('/array/', $result);
Please login to merge, or discard this patch.
lib/Cake/Test/Case/Utility/FileTest.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 /**
392 392
  * testWrite method
393 393
  *
394
- * @return void
394
+ * @return false|null
395 395
  */
396 396
 	public function testWrite() {
397 397
 		if (!$tmpFile = $this->_getTmpFile()) {
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 /**
422 422
  * testAppend method
423 423
  *
424
- * @return void
424
+ * @return false|null
425 425
  */
426 426
 	public function testAppend() {
427 427
 		if (!$tmpFile = $this->_getTmpFile()) {
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 /**
458 458
  * testDelete method
459 459
  *
460
- * @return void
460
+ * @return false|null
461 461
  */
462 462
 	public function testDelete() {
463 463
 		if (!$tmpFile = $this->_getTmpFile()) {
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
  * Windows has issues unlinking files if there are
483 483
  * active filehandles open.
484 484
  *
485
- * @return void
485
+ * @return false|null
486 486
  */
487 487
 	public function testDeleteAfterRead() {
488 488
 		if (!$tmpFile = $this->_getTmpFile()) {
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
  * getTmpFile method
545 545
  *
546 546
  * @param boolean $paintSkip
547
- * @return void
547
+ * @return string|false
548 548
  */
549 549
 	protected function _getTmpFile($paintSkip = true) {
550 550
 		$tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		unset($this->File);
56 56
 
57 57
 		$Folder = new Folder();
58
-		$Folder->delete(TMP . 'tests' . DS . 'permissions');
58
+		$Folder->delete(TMP.'tests'.DS.'permissions');
59 59
 	}
60 60
 
61 61
 /**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
  * @return void
65 65
  */
66 66
 	public function testBasic() {
67
-		$file = CAKE . DS . 'LICENSE.txt';
67
+		$file = CAKE.DS.'LICENSE.txt';
68 68
 
69 69
 		$this->File = new File($file, false);
70 70
 
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 			'mime' => 'text/plain'
83 83
 		);
84 84
 		if (
85
-			!function_exists('finfo_open') &&
86
-			(!function_exists('mime_content_type') ||
85
+			! function_exists('finfo_open') &&
86
+			( ! function_exists('mime_content_type') ||
87 87
 			function_exists('mime_content_type') &&
88 88
 			mime_content_type($this->File->pwd()) === false)
89 89
 		) {
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	public function testPermission() {
132 132
 		$this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows.');
133 133
 
134
-		$dir = TMP . 'tests' . DS . 'permissions' . DS;
134
+		$dir = TMP.'tests'.DS.'permissions'.DS;
135 135
 		$old = umask();
136 136
 
137 137
 		umask(0002);
138
-		$file = $dir . 'permission_' . uniqid();
138
+		$file = $dir.'permission_'.uniqid();
139 139
 		$expecting = decoct(0664 & ~umask());
140 140
 		$File = new File($file, true);
141 141
 		$result = $File->perms();
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		$File->delete();
144 144
 
145 145
 		umask(0022);
146
-		$file = $dir . 'permission_' . uniqid();
146
+		$file = $dir.'permission_'.uniqid();
147 147
 		$expecting = decoct(0644 & ~umask());
148 148
 		$File = new File($file, true);
149 149
 		$result = $File->perms();
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 		$File->delete();
152 152
 
153 153
 		umask(0422);
154
-		$file = $dir . 'permission_' . uniqid();
154
+		$file = $dir.'permission_'.uniqid();
155 155
 		$expecting = decoct(0244 & ~umask());
156 156
 		$File = new File($file, true);
157 157
 		$result = $File->perms();
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		$File->delete();
160 160
 
161 161
 		umask(0444);
162
-		$file = $dir . 'permission_' . uniqid();
162
+		$file = $dir.'permission_'.uniqid();
163 163
 		$expecting = decoct(0222 & ~umask());
164 164
 		$File = new File($file, true);
165 165
 		$result = $File->perms();
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		$result = $this->File->read();
182 182
 		$expecting = file_get_contents(__FILE__);
183 183
 		$this->assertEquals($expecting, $result);
184
-		$this->assertTrue(!is_resource($this->File->handle));
184
+		$this->assertTrue( ! is_resource($this->File->handle));
185 185
 
186 186
 		$this->File->lock = true;
187 187
 		$result = $this->File->read();
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
  * @return void
280 280
  */
281 281
 	public function testCreate() {
282
-		$tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
282
+		$tmpFile = TMP.'tests'.DS.'cakephp.file.test.tmp';
283 283
 		$File = new File($tmpFile, true, 0777);
284 284
 		$this->assertTrue($File->exists());
285 285
 	}
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
  * @return void
291 291
  */
292 292
 	public function testOpeningNonExistentFileCreatesIt() {
293
-		$someFile = new File(TMP . 'some_file.txt', false);
293
+		$someFile = new File(TMP.'some_file.txt', false);
294 294
 		$this->assertTrue($someFile->open());
295 295
 		$this->assertEquals('', $someFile->read());
296 296
 		$someFile->close();
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
  * @return void
324 324
  */
325 325
 	public function testReadable() {
326
-		$someFile = new File(TMP . 'some_file.txt', false);
326
+		$someFile = new File(TMP.'some_file.txt', false);
327 327
 		$this->assertTrue($someFile->open());
328 328
 		$this->assertTrue($someFile->readable());
329 329
 		$someFile->close();
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
  * @return void
337 337
  */
338 338
 	public function testWritable() {
339
-		$someFile = new File(TMP . 'some_file.txt', false);
339
+		$someFile = new File(TMP.'some_file.txt', false);
340 340
 		$this->assertTrue($someFile->open());
341 341
 		$this->assertTrue($someFile->writable());
342 342
 		$someFile->close();
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
  * @return void
350 350
  */
351 351
 	public function testExecutable() {
352
-		$someFile = new File(TMP . 'some_file.txt', false);
352
+		$someFile = new File(TMP.'some_file.txt', false);
353 353
 		$this->assertTrue($someFile->open());
354 354
 		$this->assertFalse($someFile->executable());
355 355
 		$someFile->close();
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
  * @return void
363 363
  */
364 364
 	public function testLastAccess() {
365
-		$someFile = new File(TMP . 'some_file.txt', false);
365
+		$someFile = new File(TMP.'some_file.txt', false);
366 366
 		$this->assertFalse($someFile->lastAccess());
367 367
 		$this->assertTrue($someFile->open());
368 368
 		$this->assertWithinMargin($someFile->lastAccess(), time(), 2);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
  * @return void
377 377
  */
378 378
 	public function testLastChange() {
379
-		$someFile = new File(TMP . 'some_file.txt', false);
379
+		$someFile = new File(TMP.'some_file.txt', false);
380 380
 		$this->assertFalse($someFile->lastChange());
381 381
 		$this->assertTrue($someFile->open('r+'));
382 382
 		$this->assertWithinMargin($someFile->lastChange(), time(), 2);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
  * @return void
395 395
  */
396 396
 	public function testWrite() {
397
-		if (!$tmpFile = $this->_getTmpFile()) {
397
+		if ( ! $tmpFile = $this->_getTmpFile()) {
398 398
 			return false;
399 399
 		}
400 400
 		if (file_exists($tmpFile)) {
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
  * @return void
425 425
  */
426 426
 	public function testAppend() {
427
-		if (!$tmpFile = $this->_getTmpFile()) {
427
+		if ( ! $tmpFile = $this->_getTmpFile()) {
428 428
 			return false;
429 429
 		}
430 430
 		if (file_exists($tmpFile)) {
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 			$r = $TmpFile->append($fragment);
442 442
 			$this->assertTrue($r);
443 443
 			$this->assertTrue(file_exists($tmpFile));
444
-			$data = $data . $fragment;
444
+			$data = $data.$fragment;
445 445
 			$this->assertEquals($data, file_get_contents($tmpFile));
446 446
 			$newSize = $TmpFile->size();
447 447
 			$this->assertTrue($newSize > $size);
@@ -460,11 +460,11 @@  discard block
 block discarded – undo
460 460
  * @return void
461 461
  */
462 462
 	public function testDelete() {
463
-		if (!$tmpFile = $this->_getTmpFile()) {
463
+		if ( ! $tmpFile = $this->_getTmpFile()) {
464 464
 			return false;
465 465
 		}
466 466
 
467
-		if (!file_exists($tmpFile)) {
467
+		if ( ! file_exists($tmpFile)) {
468 468
 			touch($tmpFile);
469 469
 		}
470 470
 		$TmpFile = new File($tmpFile);
@@ -485,10 +485,10 @@  discard block
 block discarded – undo
485 485
  * @return void
486 486
  */
487 487
 	public function testDeleteAfterRead() {
488
-		if (!$tmpFile = $this->_getTmpFile()) {
488
+		if ( ! $tmpFile = $this->_getTmpFile()) {
489 489
 			return false;
490 490
 		}
491
-		if (!file_exists($tmpFile)) {
491
+		if ( ! file_exists($tmpFile)) {
492 492
 			touch($tmpFile);
493 493
 		}
494 494
 		$File = new File($tmpFile);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
  * @return void
503 503
  */
504 504
 	public function testCopy() {
505
-		$dest = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
505
+		$dest = TMP.'tests'.DS.'cakephp.file.test.tmp';
506 506
 		$file = __FILE__;
507 507
 		$this->File = new File($file);
508 508
 		$result = $this->File->copy($dest);
@@ -530,8 +530,8 @@  discard block
 block discarded – undo
530 530
  * @return void
531 531
  */
532 532
 	public function testMime() {
533
-		$this->skipIf(!function_exists('finfo_open') && !function_exists('mime_content_type'), 'Not able to read mime type');
534
-		$path = CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif';
533
+		$this->skipIf( ! function_exists('finfo_open') && ! function_exists('mime_content_type'), 'Not able to read mime type');
534
+		$path = CAKE.'Test'.DS.'test_app'.DS.'webroot'.DS.'img'.DS.'cake.power.gif';
535 535
 		$file = new File($path);
536 536
 		$expected = 'image/gif';
537 537
 		if (function_exists('mime_content_type') && mime_content_type($file->pwd()) === false) {
@@ -547,8 +547,8 @@  discard block
 block discarded – undo
547 547
  * @return void
548 548
  */
549 549
 	protected function _getTmpFile($paintSkip = true) {
550
-		$tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
551
-		if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
550
+		$tmpFile = TMP.'tests'.DS.'cakephp.file.test.tmp';
551
+		if (is_writable(dirname($tmpFile)) && ( ! file_exists($tmpFile) || is_writable($tmpFile))) {
552 552
 			return $tmpFile;
553 553
 		}
554 554
 
Please login to merge, or discard this patch.