Completed
Push — scrutinizer ( 84e9d0...6a9613 )
by Fabio
22:48
created
tests/unit/I18N/core/AllTests.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@
 block discarded – undo
13 13
 
14 14
 class I18N_core_AllTests {
15 15
   public static function main() {
16
-    PHPUnit_TextUI_TestRunner::run(self::suite());
16
+	PHPUnit_TextUI_TestRunner::run(self::suite());
17 17
   }
18 18
 
19 19
   public static function suite() {
20
-    $suite = new PHPUnit_Framework_TestSuite('System.I18N.core');
20
+	$suite = new PHPUnit_Framework_TestSuite('System.I18N.core');
21 21
 
22
-    $suite->addTestSuite('CultureInfoTest');
22
+	$suite->addTestSuite('CultureInfoTest');
23 23
 	$suite->addTestSuite('DateFormatTest');
24 24
 	$suite->addTestSuite('DateTimeFormatInfoTest');
25 25
 	$suite->addTestSuite('NumberFormatInfoTest');
26 26
 	$suite->addTestSuite('NumberFormatTest');
27 27
 
28
-    return $suite;
28
+	return $suite;
29 29
   }
30 30
 }
31 31
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-if(!defined('PHPUnit_MAIN_METHOD')) {
4
+if (!defined('PHPUnit_MAIN_METHOD')) {
5 5
   define('PHPUnit_MAIN_METHOD', 'I18N_core_AllTests::main');
6 6
 }
7 7
 
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
   }
30 30
 }
31 31
 
32
-if(PHPUnit_MAIN_METHOD == 'I18N_core_AllTests::main') {
32
+if (PHPUnit_MAIN_METHOD == 'I18N_core_AllTests::main') {
33 33
   I18N_core_AllTests::main();
34 34
 }
Please login to merge, or discard this patch.
tests/unit/Util/AllTests.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@
 block discarded – undo
9 9
 
10 10
 class Util_AllTests {
11 11
   public static function main() {
12
-    PHPUnit_TextUI_TestRunner::run(self::suite());
12
+	PHPUnit_TextUI_TestRunner::run(self::suite());
13 13
   }
14 14
 
15 15
   public static function suite() {
16
-    $suite = new PHPUnit_Framework_TestSuite('System.Util');
16
+	$suite = new PHPUnit_Framework_TestSuite('System.Util');
17 17
 
18 18
 	$suite->addTestSuite('TDateTimeStampTest');
19 19
 	$suite->addTestSuite('TLoggerTest');
20 20
 
21
-    return $suite;
21
+	return $suite;
22 22
   }
23 23
 }
24 24
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('PHPUnit_MAIN_METHOD')) {
3
+if (!defined('PHPUnit_MAIN_METHOD')) {
4 4
   define('PHPUnit_MAIN_METHOD', 'Util_AllTests::main');
5 5
 }
6 6
 
@@ -22,6 +22,6 @@  discard block
 block discarded – undo
22 22
   }
23 23
 }
24 24
 
25
-if(PHPUnit_MAIN_METHOD == 'Util_AllTests::main') {
25
+if (PHPUnit_MAIN_METHOD == 'Util_AllTests::main') {
26 26
   Util_AllTests::main();
27 27
 }
Please login to merge, or discard this patch.
tests/unit/Caching/TFileCacheDependencyTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -15,40 +15,40 @@
 block discarded – undo
15 15
 
16 16
 	public function testFileName()
17 17
 	{
18
-		$dependency=new TFileCacheDependency(__FILE__);
19
-		$this->assertEquals($dependency->getFileName(),__FILE__);
20
-		$this->assertEquals($dependency->getTimestamp(),filemtime(__FILE__));
18
+		$dependency = new TFileCacheDependency(__FILE__);
19
+		$this->assertEquals($dependency->getFileName(), __FILE__);
20
+		$this->assertEquals($dependency->getTimestamp(), filemtime(__FILE__));
21 21
 
22
-		$dependency=new TFileCacheDependency(dirname(__FILE__).'/foo.txt');
22
+		$dependency = new TFileCacheDependency(dirname(__FILE__) . '/foo.txt');
23 23
 		$this->assertFalse($dependency->getTimestamp());
24 24
 	}
25 25
 
26 26
 	public function testHasChanged()
27 27
 	{
28
-		$tempFile=dirname(__FILE__).'/temp/foo.txt';
28
+		$tempFile = dirname(__FILE__) . '/temp/foo.txt';
29 29
 		@unlink($tempFile);
30
-		$fw=fopen($tempFile,"w");
31
-		fwrite($fw,"test");
30
+		$fw = fopen($tempFile, "w");
31
+		fwrite($fw, "test");
32 32
 		fclose($fw);
33 33
 		clearstatcache();
34 34
 
35
-		$dependency=new TFileCacheDependency($tempFile);
36
-		$str=serialize($dependency);
35
+		$dependency = new TFileCacheDependency($tempFile);
36
+		$str = serialize($dependency);
37 37
 
38 38
 		// test file not changed
39 39
 		sleep(2);
40
-		$dependency=unserialize($str);
40
+		$dependency = unserialize($str);
41 41
 		$this->assertFalse($dependency->getHasChanged());
42 42
 
43 43
 		// change file
44
-		$fw=fopen($tempFile,"w");
45
-		fwrite($fw,"test again");
44
+		$fw = fopen($tempFile, "w");
45
+		fwrite($fw, "test again");
46 46
 		fclose($fw);
47 47
 		clearstatcache();
48 48
 
49 49
 		// test file changed
50 50
 		sleep(2);
51
-		$dependency=unserialize($str);
51
+		$dependency = unserialize($str);
52 52
 		$this->assertTrue($dependency->getHasChanged());
53 53
 
54 54
 		@unlink($tempFile);
Please login to merge, or discard this patch.
tests/unit/Caching/TAPCCacheTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@  discard block
 block discarded – undo
11 11
 	protected static $cache = null;
12 12
 
13 13
 	protected function setUp() {
14
-		if(!extension_loaded('apc')) {
14
+		if (!extension_loaded('apc')) {
15 15
 			self::markTestSkipped('The APC extension is not available');
16 16
 		} else {
17
-				$basePath = dirname(__FILE__).'/mockapp';
18
-				$runtimePath = $basePath.'/runtime';
19
-				if(!is_writable($runtimePath)) {
17
+				$basePath = dirname(__FILE__) . '/mockapp';
18
+				$runtimePath = $basePath . '/runtime';
19
+				if (!is_writable($runtimePath)) {
20 20
 					self::markTestSkipped("'$runtimePath' is writable");
21 21
 				}
22 22
 				try {
23 23
 					$this->app = new TApplication($basePath);
24 24
 					self::$cache = new TAPCCache();
25 25
 					self::$cache->init(null);
26
-				} catch(TConfigurationException $e) {
26
+				} catch (TConfigurationException $e) {
27 27
 					self::markTestSkipped($e->getMessage());
28 28
 				}
29 29
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	public function testAdd() {
60 60
 		try {
61 61
 			self::$cache->add('anotherkey', 'value');
62
-		} catch(TNotSupportedException $e) {
62
+		} catch (TNotSupportedException $e) {
63 63
 			self::markTestSkipped('apc_add is not supported');
64 64
 			return;
65 65
 		}
Please login to merge, or discard this patch.
tests/unit/Caching/TMemCacheTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
 	protected static $cache = null;
12 12
 
13 13
 	protected function setUp() {
14
-		if(!extension_loaded('memcache')) {
14
+		if (!extension_loaded('memcache')) {
15 15
 			self::markTestSkipped('The memcache extension is not available');
16 16
 		} else {
17
-				$basePath = dirname(__FILE__).'/mockapp';
18
-				$runtimePath = $basePath.'/runtime';
19
-				if(!is_writable($runtimePath)) {
17
+				$basePath = dirname(__FILE__) . '/mockapp';
18
+				$runtimePath = $basePath . '/runtime';
19
+				if (!is_writable($runtimePath)) {
20 20
 					self::markTestSkipped("'$runtimePath' is not writable");
21 21
 				}
22 22
 				$this->app = new TApplication($basePath);
Please login to merge, or discard this patch.
tests/unit/Caching/TSqliteCacheTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@
 block discarded – undo
11 11
 	protected static $cache = null;
12 12
 
13 13
 	protected function setUp() {
14
-		if(!extension_loaded('sqlite')) {
14
+		if (!extension_loaded('sqlite')) {
15 15
 			self::markTestSkipped('The SQLite extension is not available');
16 16
 		} else {
17
-			if(self::$app === null) {
17
+			if (self::$app === null) {
18 18
 
19
-				$basePath = dirname(__FILE__).'/mockapp';
20
-				$runtimePath = $basePath.'/runtime';
21
-				if(!is_writable($runtimePath)) {
19
+				$basePath = dirname(__FILE__) . '/mockapp';
20
+				$runtimePath = $basePath . '/runtime';
21
+				if (!is_writable($runtimePath)) {
22 22
 					self::markTestSkipped("'$runtimePath' is writable");
23 23
 				}
24 24
 				self::$app = new TApplication($basePath);
Please login to merge, or discard this patch.
tests/unit/Caching/TDirectoryCacheDependencyTest.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -15,24 +15,24 @@  discard block
 block discarded – undo
15 15
 
16 16
 	public function testDirectoryName()
17 17
 	{
18
-		$directory=realpath(dirname(__FILE__).'/temp');
19
-		$dependency=new TDirectoryCacheDependency(dirname(__FILE__).'/temp');
20
-		$this->assertEquals($dependency->getDirectory(),$directory);
18
+		$directory = realpath(dirname(__FILE__) . '/temp');
19
+		$dependency = new TDirectoryCacheDependency(dirname(__FILE__) . '/temp');
20
+		$this->assertEquals($dependency->getDirectory(), $directory);
21 21
 
22 22
 		try
23 23
 		{
24
-			$dependency=new TDirectoryCacheDependency(dirname(__FILE__).'/temp2');
24
+			$dependency = new TDirectoryCacheDependency(dirname(__FILE__) . '/temp2');
25 25
 			$this->fail("Expected exception is not raised");
26 26
 		}
27
-		catch(TInvalidDataValueException $e)
27
+		catch (TInvalidDataValueException $e)
28 28
 		{
29 29
 		}
30 30
 	}
31 31
 
32 32
 	public function testRecursiveCheck()
33 33
 	{
34
-		$directory=realpath(dirname(__FILE__).'/temp');
35
-		$dependency=new TDirectoryCacheDependency(dirname(__FILE__).'/temp');
34
+		$directory = realpath(dirname(__FILE__) . '/temp');
35
+		$dependency = new TDirectoryCacheDependency(dirname(__FILE__) . '/temp');
36 36
 		$this->assertTrue($dependency->getRecursiveCheck());
37 37
 		$dependency->setRecursiveCheck(false);
38 38
 		$this->assertFalse($dependency->getRecursiveCheck());
@@ -40,39 +40,39 @@  discard block
 block discarded – undo
40 40
 
41 41
 	public function testRecursiveLevel()
42 42
 	{
43
-		$directory=realpath(dirname(__FILE__).'/temp');
44
-		$dependency=new TDirectoryCacheDependency(dirname(__FILE__).'/temp');
45
-		$this->assertEquals($dependency->getRecursiveLevel(),-1);
43
+		$directory = realpath(dirname(__FILE__) . '/temp');
44
+		$dependency = new TDirectoryCacheDependency(dirname(__FILE__) . '/temp');
45
+		$this->assertEquals($dependency->getRecursiveLevel(), -1);
46 46
 		$dependency->setRecursiveLevel(5);
47
-		$this->assertEquals($dependency->getRecursiveLevel(),5);
47
+		$this->assertEquals($dependency->getRecursiveLevel(), 5);
48 48
 	}
49 49
 
50 50
 	public function testHasChanged()
51 51
 	{
52
-		$tempFile=dirname(__FILE__).'/temp/foo.txt';
52
+		$tempFile = dirname(__FILE__) . '/temp/foo.txt';
53 53
 		@unlink($tempFile);
54
-		$fw=fopen($tempFile,"w");
55
-		fwrite($fw,"test");
54
+		$fw = fopen($tempFile, "w");
55
+		fwrite($fw, "test");
56 56
 		fclose($fw);
57 57
 		clearstatcache();
58 58
 
59
-		$dependency=new TDirectoryCacheDependency(dirname($tempFile));
60
-		$str=serialize($dependency);
59
+		$dependency = new TDirectoryCacheDependency(dirname($tempFile));
60
+		$str = serialize($dependency);
61 61
 
62 62
 		// test directory not changed
63 63
 		sleep(2);
64
-		$dependency=unserialize($str);
64
+		$dependency = unserialize($str);
65 65
 		$this->assertFalse($dependency->getHasChanged());
66 66
 
67 67
 		// change file
68
-		$fw=fopen($tempFile,"w");
69
-		fwrite($fw,"test again");
68
+		$fw = fopen($tempFile, "w");
69
+		fwrite($fw, "test again");
70 70
 		fclose($fw);
71 71
 		clearstatcache();
72 72
 
73 73
 		// test file changed
74 74
 		sleep(2);
75
-		$dependency=unserialize($str);
75
+		$dependency = unserialize($str);
76 76
 		$this->assertTrue($dependency->getHasChanged());
77 77
 
78 78
 		@unlink($tempFile);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
 		{
24 24
 			$dependency=new TDirectoryCacheDependency(dirname(__FILE__).'/temp2');
25 25
 			$this->fail("Expected exception is not raised");
26
-		}
27
-		catch(TInvalidDataValueException $e)
26
+		} catch(TInvalidDataValueException $e)
28 27
 		{
29 28
 		}
30 29
 	}
Please login to merge, or discard this patch.
tests/unit/Caching/AllTests.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
 
11 11
 class Caching_AllTests {
12 12
   public static function main() {
13
-    PHPUnit_TextUI_TestRunner::run(self::suite());
13
+	PHPUnit_TextUI_TestRunner::run(self::suite());
14 14
   }
15 15
 
16 16
   public static function suite() {
17
-    $suite = new PHPUnit_Framework_TestSuite('System.Caching');
17
+	$suite = new PHPUnit_Framework_TestSuite('System.Caching');
18 18
 
19 19
 	$suite->addTestSuite('TSqliteCacheTest');
20 20
 	$suite->addTestSuite('TAPCCacheTest');
21 21
 	$suite->addTestSuite('TMemCacheTest');
22 22
 
23
-    return $suite;
23
+	return $suite;
24 24
   }
25 25
 }
26 26
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('PHPUnit_MAIN_METHOD')) {
3
+if (!defined('PHPUnit_MAIN_METHOD')) {
4 4
   define('PHPUnit_MAIN_METHOD', 'Caching_AllTests::main');
5 5
 }
6 6
 
@@ -24,6 +24,6 @@  discard block
 block discarded – undo
24 24
   }
25 25
 }
26 26
 
27
-if(PHPUnit_MAIN_METHOD == 'Caching_AllTests::main') {
27
+if (PHPUnit_MAIN_METHOD == 'Caching_AllTests::main') {
28 28
   Caching_AllTests::main();
29 29
 }
Please login to merge, or discard this patch.
tests/unit/Web/TUriTest.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,18 +10,18 @@  discard block
 block discarded – undo
10 10
   const URISTR='http://login:p@ssw0rd:[email protected]:80/demos/quickstart/index.php?page=test&param1=test2#anchor';
11 11
 
12 12
   public function setUp () {
13
-    $this->uri=new TUri(self::URISTR);
13
+	$this->uri=new TUri(self::URISTR);
14 14
   }
15 15
 
16 16
   public function tearDown() {
17
-    $this->uri=null;
17
+	$this->uri=null;
18 18
   }
19 19
 
20 20
   public function testConstruct() {
21
-    $url="http://www.pradoframework.net/";
22
-    $uri=new TUri ($url);
23
-    self::assertEquals($url, $uri->getUri() );
24
-    // Bad uri test
21
+	$url="http://www.pradoframework.net/";
22
+	$uri=new TUri ($url);
23
+	self::assertEquals($url, $uri->getUri() );
24
+	// Bad uri test
25 25
 	$url="http://www.pradoframework.net:badport/test";
26 26
 	try {
27 27
 	  $url=new TUri($url);
@@ -32,38 +32,38 @@  discard block
 block discarded – undo
32 32
   }
33 33
 
34 34
   public function testGetUri() {
35
-    self::assertEquals(self::URISTR, $this->uri->getUri());
35
+	self::assertEquals(self::URISTR, $this->uri->getUri());
36 36
   }
37 37
 
38 38
   public function testGetScheme() {
39
-    self::assertEquals('http', $this->uri->getScheme());
39
+	self::assertEquals('http', $this->uri->getScheme());
40 40
   }
41 41
 
42 42
   public function testGetHost() {
43
-    self::assertEquals('www.pradoframework.net', $this->uri->getHost());
43
+	self::assertEquals('www.pradoframework.net', $this->uri->getHost());
44 44
   }
45 45
 
46 46
   public function testGetPort() {
47
-    self::assertEquals(80, $this->uri->getPort());
47
+	self::assertEquals(80, $this->uri->getPort());
48 48
   }
49 49
 
50 50
   public function testGetUser() {
51
-    self::assertEquals('login', $this->uri->getUser());
51
+	self::assertEquals('login', $this->uri->getUser());
52 52
   }
53 53
 
54 54
   public function testGetPassword() {
55
-    self::assertEquals('p@ssw0rd:compl3x', $this->uri->getPassword());
55
+	self::assertEquals('p@ssw0rd:compl3x', $this->uri->getPassword());
56 56
   }
57 57
 
58 58
   public function testGetPath() {
59
-    self::assertEquals('/demos/quickstart/index.php', $this->uri->getPath());
59
+	self::assertEquals('/demos/quickstart/index.php', $this->uri->getPath());
60 60
   }
61 61
 
62 62
   public function testGetQuery() {
63
-    self::assertEquals('page=test&param1=test2', $this->uri->getQuery());
63
+	self::assertEquals('page=test&param1=test2', $this->uri->getQuery());
64 64
   }
65 65
 
66 66
   public function testGetFragment() {
67
-    self::assertEquals('anchor', $this->uri->getFragment());
67
+	self::assertEquals('anchor', $this->uri->getFragment());
68 68
   }
69 69
 }
70 70
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@
 block discarded – undo
7 7
  */
8 8
 class TUriTest extends PHPUnit_Framework_TestCase {
9 9
 
10
-  const URISTR='http://login:p@ssw0rd:[email protected]:80/demos/quickstart/index.php?page=test&param1=test2#anchor';
10
+  const URISTR = 'http://login:p@ssw0rd:[email protected]:80/demos/quickstart/index.php?page=test&param1=test2#anchor';
11 11
 
12
-  public function setUp () {
13
-    $this->uri=new TUri(self::URISTR);
12
+  public function setUp() {
13
+    $this->uri = new TUri(self::URISTR);
14 14
   }
15 15
 
16 16
   public function tearDown() {
17
-    $this->uri=null;
17
+    $this->uri = null;
18 18
   }
19 19
 
20 20
   public function testConstruct() {
21
-    $url="http://www.pradoframework.net/";
22
-    $uri=new TUri ($url);
23
-    self::assertEquals($url, $uri->getUri() );
21
+    $url = "http://www.pradoframework.net/";
22
+    $uri = new TUri($url);
23
+    self::assertEquals($url, $uri->getUri());
24 24
     // Bad uri test
25
-	$url="http://www.pradoframework.net:badport/test";
25
+	$url = "http://www.pradoframework.net:badport/test";
26 26
 	try {
27
-	  $url=new TUri($url);
28
-	  self::fail ('exception not raised with an invalid URL');
27
+	  $url = new TUri($url);
28
+	  self::fail('exception not raised with an invalid URL');
29 29
 	} catch (TInvalidDataValueException $e) {
30 30
 
31 31
 	}
Please login to merge, or discard this patch.