Completed
Pull Request — master (#161)
by Kenji
02:44 queued 21s
created
application/tests/_ci_phpunit_test/CIPHPUnitTestDouble.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 				break;
87 87
 			default:
88 88
 				throw new RuntimeException(
89
-					'Sorry, ' . $count . ' params not implemented yet'
89
+					'Sorry, '.$count.' params not implemented yet'
90 90
 				);
91 91
 		}
92 92
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,7 @@
 block discarded – undo
48 48
 		if ($constructor_params === false)
49 49
 		{
50 50
 			$mock->disableOriginalConstructor();
51
-		}
52
-		elseif (is_array($constructor_params))
51
+		} elseif (is_array($constructor_params))
53 52
 		{
54 53
 			$mock->setConstructorArgs($constructor_params);
55 54
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestFileCache.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@
 block discarded – undo
24 24
 		}
25 25
 
26 26
 		$dir = dirname($this->file);
27
-		if (! is_dir($dir))
27
+		if ( ! is_dir($dir))
28 28
 		{
29 29
 			if (@mkdir($dir, 0777, true) === false)
30 30
 			{
31
-				throw new RuntimeException('Failed to create folder: ' . $dir);
31
+				throw new RuntimeException('Failed to create folder: '.$dir);
32 32
 			}
33 33
 		}
34 34
 
35 35
 		if (file_put_contents($this->file, '') === false)
36 36
 		{
37 37
 			throw new RuntimeException(
38
-				'Failed to write to cache file: ' . $this->file
38
+				'Failed to write to cache file: '.$this->file
39 39
 			);
40 40
 		}
41 41
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
 		{
39 39
 			$patched = true;
40 40
 			$new_source = static::generateNewSource($source);
41
-		}
42
-		else
41
+		} else
43 42
 		{
44 43
 			$new_source = $source;
45 44
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestReflection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		$ref_method->setAccessible(true);
22 22
 		$obj = (gettype($obj) === 'object') ? $obj : null;
23 23
 
24
-		return function () use ($obj, $ref_method) {
24
+		return function() use ($obj, $ref_method) {
25 25
 			$args = func_get_args();
26 26
 			return $ref_method->invokeArgs($obj, $args);
27 27
 		};
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestRouter.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@
 block discarded – undo
29 29
 		if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
30 30
 		{
31 31
 			$e404 = TRUE;
32
-		}
33
-		else
32
+		} else
34 33
 		{
35 34
 			require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php');
36 35
 
37 36
 			if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method))
38 37
 			{
39 38
 				$e404 = TRUE;
40
-			}
41
-			elseif (method_exists($class, '_remap'))
39
+			} elseif (method_exists($class, '_remap'))
42 40
 			{
43 41
 				$params = array($method, array_slice($URI->rsegments, 2));
44 42
 				$method = '_remap';
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	public function getRoute()
21 21
 	{
22
-		$RTR =& load_class('Router', 'core');
23
-		$URI =& load_class('URI', 'core');
22
+		$RTR = & load_class('Router', 'core');
23
+		$URI = & load_class('URI', 'core');
24 24
 
25 25
 		$e404 = FALSE;
26 26
 		$class = ucfirst($RTR->class);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		{
58 58
 			// If 404, CodeIgniter instance is not created yet. So create it here.
59 59
 			// Because we need $this->CI->output->_status
60
-			$CI =& get_instance();
60
+			$CI = & get_instance();
61 61
 			if ($CI === null)
62 62
 			{
63 63
 				new CI_Controller();
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/autoloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Autoloader for ci-phpunit-test
12
-require __DIR__ . '/CIPHPUnitTestAutoloader.php';
13
-require __DIR__ . '/CIPHPUnitTestFileCache.php';
12
+require __DIR__.'/CIPHPUnitTestAutoloader.php';
13
+require __DIR__.'/CIPHPUnitTestFileCache.php';
14 14
 $cache = new CIPHPUnitTestFileCache(
15
-	__DIR__ . '/tmp/cache/autoload.php'
15
+	__DIR__.'/tmp/cache/autoload.php'
16 16
 );
17 17
 $autoload_dirs = CIPHPUnitTest::getAutoloadDirs();
18 18
 $autoloader = new CIPHPUnitTestAutoloader($cache, $autoload_dirs);
@@ -20,5 +20,5 @@  discard block
 block discarded – undo
20 20
 
21 21
 // Register CodeIgniter's tests/mocks/autoloader.php
22 22
 define('SYSTEM_PATH', BASEPATH);
23
-require APPPATH .'tests/mocks/autoloader.php';
23
+require APPPATH.'tests/mocks/autoloader.php';
24 24
 spl_autoload_register('autoload');
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/IncludeStream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 	{
60 60
 		$this->unwrap();
61 61
 
62
-		MonkeyPatchManager::log('stream_open: ' . $path);
62
+		MonkeyPatchManager::log('stream_open: '.$path);
63 63
 
64 64
 		$including = (bool) ($options & self::STREAM_OPEN_FOR_INCLUDE);
65 65
 		if ($including && $this->shouldPreprocess($path)) {
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/InvocationVerifier.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 					PHPUnit_Framework_TestCase::assertEquals(
55 55
 						$expected_times,
56 56
 						$actual_times,
57
-						$class_method . '() expected to be not invoked, but invoked ' . $actual_times . ' times.'
57
+						$class_method.'() expected to be not invoked, but invoked '.$actual_times.' times.'
58 58
 					);
59 59
 				}
60 60
 				elseif ($expected_times === '+')
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 					PHPUnit_Framework_TestCase::assertGreaterThanOrEqual(
63 63
 						1,
64 64
 						$actual_times,
65
-						$class_method . '() expected to be invoked at least one time, but invoked ' . $actual_times . ' times.'
65
+						$class_method.'() expected to be invoked at least one time, but invoked '.$actual_times.' times.'
66 66
 					);
67 67
 				}
68 68
 				else
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 					PHPUnit_Framework_TestCase::assertEquals(
71 71
 						$expected_times,
72 72
 						$actual_times,
73
-						$class_method . '() expected to be invoked ' . $expected_times . ' times, but invoked ' . $actual_times . ' times.'
73
+						$class_method.'() expected to be invoked '.$expected_times.' times, but invoked '.$actual_times.' times.'
74 74
 					);
75 75
 				}
76 76
 			}
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,12 +31,10 @@  discard block
 block discarded – undo
31 31
 				if ($invoked === false)
32 32
 				{
33 33
 					$actual_times = 0;
34
-				}
35
-				elseif ($expected_params === null)
34
+				} elseif ($expected_params === null)
36 35
 				{
37 36
 					$actual_times = count($invocations[$class_method]);
38
-				}
39
-				else
37
+				} else
40 38
 				{
41 39
 					$count = 0;
42 40
 					foreach ($invocations[$class_method] as $actual_params)
@@ -56,16 +54,14 @@  discard block
 block discarded – undo
56 54
 						$actual_times,
57 55
 						$class_method . '() expected to be not invoked, but invoked ' . $actual_times . ' times.'
58 56
 					);
59
-				}
60
-				elseif ($expected_times === '+')
57
+				} elseif ($expected_times === '+')
61 58
 				{
62 59
 					PHPUnit_Framework_TestCase::assertGreaterThanOrEqual(
63 60
 						1,
64 61
 						$actual_times,
65 62
 						$class_method . '() expected to be invoked at least one time, but invoked ' . $actual_times . ' times.'
66 63
 					);
67
-				}
68
-				else
64
+				} else
69 65
 				{
70 66
 					PHPUnit_Framework_TestCase::assertEquals(
71 67
 						$expected_times,
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/Patcher/AbstractPatcher.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
 		{
39 39
 			$patched = true;
40 40
 			$new_source = static::generateNewSource($source);
41
-		}
42
-		else
41
+		} else
43 42
 		{
44 43
 			$new_source = $source;
45 44
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/Patcher/Backtrace.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 	public static function getInfo($patcher, $backtrace)
23 23
 	{
24
-		if (! isset(self::$map[$patcher]))
24
+		if ( ! isset(self::$map[$patcher]))
25 25
 		{
26 26
 			throw new LogicException("No such a patcher: $patcher");
27 27
 		}
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 		$line = isset($backtrace[$offset]['line'])
42 42
 				? $backtrace[$offset]['line'] : null;
43 43
 
44
-		if (isset($backtrace[$offset+2]))
44
+		if (isset($backtrace[$offset + 2]))
45 45
 		{
46
-			$class  = isset($backtrace[$offset+2]['class'])
47
-					? $backtrace[$offset+2]['class']
46
+			$class = isset($backtrace[$offset + 2]['class'])
47
+					? $backtrace[$offset + 2]['class']
48 48
 					: null;
49
-			$function = $backtrace[$offset+2]['function'];
49
+			$function = $backtrace[$offset + 2]['function'];
50 50
 		}
51 51
 		else
52 52
 		{
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		if (isset($class))
58 58
 		{
59 59
 			$method = $function;
60
-			$class_method = $class . '::' . $function;
60
+			$class_method = $class.'::'.$function;
61 61
 			$function = null;
62 62
 		}
63 63
 		else
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,7 @@  discard block
 block discarded – undo
47 47
 					? $backtrace[$offset+2]['class']
48 48
 					: null;
49 49
 			$function = $backtrace[$offset+2]['function'];
50
-		}
51
-		else
50
+		} else
52 51
 		{
53 52
 			$class = null;
54 53
 			$function = null;
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
 			$method = $function;
60 59
 			$class_method = $class . '::' . $function;
61 60
 			$function = null;
62
-		}
63
-		else
61
+		} else
64 62
 		{
65 63
 			$method = null;
66 64
 			$class_method = null;
Please login to merge, or discard this patch.