Commits

namtrankhanh  committed 856a042

make small change

  • Participants
  • Parent commits d72ac00

Comments (0)

Files changed (1)

File app/protected/extensions/zurmoinc/framework/tests/unit/DatabaseCompatibilityUtilTest.php

         public function setup()
         {
             RedBeanDatabase::close();
-            RedBeanDatabase::setup(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password, true);
+            RedBeanDatabase::setup(Yii::app()->db->connectionString, 
+			           Yii::app()->db->username, 
+				   Yii::app()->db->password, 
+				   true);
         }
 
         public function tearDown()
         {
             RedBeanDatabase::close();
-            RedBeanDatabase::setup(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password, true);
+            RedBeanDatabase::setup(Yii::app()->db->connectionString, 
+	                           Yii::app()->db->username, 
+				   Yii::app()->db->password, 
+				   true);
         }
 
         public function testCharLength()
 
         public function testGetDatabaseMaxAllowedPacketsSize()
         {
-            $maxAllowedPacketSize = DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSize('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort);
+            $maxAllowedPacketSize = DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSize('mysql', 
+	    											$this->hostname, 
+												$this->rootUsername, 
+												$this->rootPassword, 
+												$this->databasePort);
             $this->assertGreaterThan(0, $maxAllowedPacketSize);
         }
 
         public function testGetDatabaseMaxSpRecursionDepth()
         {
-            $maxSpRecursionDepth = DatabaseCompatibilityUtil::getDatabaseMaxSpRecursionDepth('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort);
+            $maxSpRecursionDepth = DatabaseCompatibilityUtil::getDatabaseMaxSpRecursionDepth('mysql', 
+	    	                                                                             $this->hostname, 
+											     $this->rootUsername, 
+											     $this->rootPassword, 
+											     $this->databasePort);
             $this->assertGreaterThan(0, $maxSpRecursionDepth);
         }
 
         public function testGetDatabaseThreadStackValue()
         {
-            $threadStackValue = DatabaseCompatibilityUtil::getDatabaseThreadStackValue('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort);
+$threadStackValue = DatabaseCompatibilityUtil::getDatabaseThreadStackValue('mysql',
+                                                                          $this->hostname,
+                                                                          $this->rootUsername,
+                                                                          $this->rootPassword,
+                                                                          $this->databasePort);
             $this->assertGreaterThan(0, $threadStackValue);
         }
 
         public function testGetDatabaseDefaultCollation()
         {
-            $dbDefaultCollation = DatabaseCompatibilityUtil::getDatabaseDefaultCollation('mysql', $this->hostname, $this->existingDatabaseName, $this->rootUsername, $this->rootPassword, $this->databasePort);
+            $dbDefaultCollation = DatabaseCompatibilityUtil::getDatabaseDefaultCollation('mysql',
+                                                                                          $this->hostname,
+                                                                                          $this->existingDatabaseName,
+                                                                                          $this->rootUsername,
+                                                                                          $this->rootPassword,
+                                                                                          $this->databasePort);
             $this->assertTrue(is_string($dbDefaultCollation));
             $this->assertTrue(strlen($dbDefaultCollation) > 0);
         }
 
         public function testIsDatabaseStrictMode()
         {
-            $isDatabaseStrictMode = DatabaseCompatibilityUtil::isDatabaseStrictMode('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort);
+            $isDatabaseStrictMode = DatabaseCompatibilityUtil::isDatabaseStrictMode('mysql',
+                                                                                    $this->hostname,
+                                                                                    $this->rootUsername,
+                                                                                    $this->rootPassword,
+                                                                                    $this->databasePort);
             $this->assertTrue(is_bool($isDatabaseStrictMode));
         }
 
         public function testDatabaseConnection_mysql()
         {
             $this->assertTrue(DatabaseCompatibilityUtil::checkDatabaseConnection('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort));
-            $this->assertEquals(array(1045, "Access denied for user '{$this->rootUsername}'@'{$this->hostname}' (using password: YES)"), DatabaseCompatibilityUtil::checkDatabaseConnection('mysql', $this->hostname, $this->rootUsername, 'wrong', $this->databasePort));
-            $this->assertEquals(array(1045, "Access denied for user 'nobody'@'{$this->hostname}' (using password: YES)"), DatabaseCompatibilityUtil::checkDatabaseConnection('mysql', $this->hostname, 'nobody', 'password', $this->databasePort));
+            $this->assertEquals(array(1045, "Access denied for user '{$this->rootUsername}'@'{$this->hostname}' (using password: YES)"), 
+	    	DatabaseCompatibilityUtil::checkDatabaseConnection('mysql', $this->hostname, $this->rootUsername, 'wrong', $this->databasePort));
+            $this->assertEquals(array(1045, "Access denied for user 'nobody'@'{$this->hostname}' (using password: YES)"), 
+	    	DatabaseCompatibilityUtil::checkDatabaseConnection('mysql', $this->hostname, 'nobody', 'password', $this->databasePort));
+
         }
 
         public function testCheckDatabaseExists()
             // This test cannot run as saltdev. It is therefore skipped on the server.
             if ($this->rootUsername == 'root')
             {
-                $this->assertTrue(DatabaseCompatibilityUtil::checkDatabaseExists('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort, $this->existingDatabaseName));
-                $this->assertEquals(array(1049, "Unknown database 'junk'"), DatabaseCompatibilityUtil::checkDatabaseExists('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort, 'junk'));
+                $this->assertTrue  (DatabaseCompatibilityUtil::checkDatabaseExists('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort, $this->existingDatabaseName));
+                $this->assertEquals(array(1049, "Unknown database 'junk'"),
+                DatabaseCompatibilityUtil::checkDatabaseExists('mysql', $this->hostname, $this->rootUsername, $this->rootPassword, $this->databasePort, 'junk'));
             }
         }