Skip to content
This repository

Added some method inside JDatabaseDriver to create database and alter character set [v2] #1625

Closed
wants to merge 2 commits into from

5 participants

gpongelli elinw Nikolai Plath ianmacl Andrew Eddie
gpongelli

Added two public method inside JDatabaseDriver:

  • alterDbCharacterSet to change database's character set
  • createDatabase to create a new database

AlterDbCharacterSet needs database name as parameter, createDatabase needs a JObject, similar to that used inside CMS' "initialise" function, and a bool to set UTF8 database's support.

They use two protected method to obtain correct query in database's
supported syntax:

  • getAlterDbCharacterSet
  • getCreateDatabaseQuery

Protected method inside JDatabaseDriver return query for MySQL and MySQLi syntax, this commit contain also overridden version for PostgreSQL database.

There are tests only for protected methods inside MySQL, MySQLi and PostgreSQL test classes.

Old Pull request

gpongelli gpongelli Added some method inside JDatabaseDriver to create database and alter
character set for MySQL, MySQLi and PostgreSQL.
Added test too.
c5a0547
elinw

Gabriele you have a unit test failure but I'm not sure why.

gpongelli
gpongelli

I see it's related to JOAuth2ClientTest, I've not developed that test.
Check if this error is also present on master branch, I forked from it yesterday to create this pull request.

libraries/joomla/database/driver/postgresql.php
((17 lines not shown))
1121 1119 *
1122   - * @since 12.1
  1120 + * @since 12.2
1
elinw
elinw added a note

12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...s/suites/database/driver/mysql/JDatabaseMySQLTest.php
@@ -17,6 +17,22 @@
17 17 class JDatabaseMysqlTest extends TestCaseDatabaseMysql
18 18 {
19 19 /**
  20 + * Data for the getCreateDbQuery test.
  21 + *
  22 + * @return array
  23 + *
  24 + * @since 11.3
1
elinw
elinw added a note

12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...suites/database/driver/mysqli/JDatabaseMySQLiTest.php
@@ -17,6 +17,22 @@
17 17 class JDatabaseMysqliTest extends TestCaseDatabaseMysqli
18 18 {
19 19 /**
  20 + * Data for the getCreateDbQuery test.
  21 + *
  22 + * @return array
  23 + *
  24 + * @since 11.3
  25 + */
2
elinw
elinw added a note

12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
elinw

So in some indirect way this change is impacting OAuth2 the issue to figure out is how.

ianmacl
Owner

The error is an intermittent error related to comparing timestamps and has been fixed in master so don't worry about it (though if you rebase it will go away).

My main question regarding this pull request is that it would seem better to use the PHP methods to do this so that the client is aware of what it is supposed to be sending rather than using direct queries.

Andrew Eddie

The JDatabaseImporter classes are already handling schema manipulation. My personal preference would be to continue to do this outside of the driver itself, maybe even starting some sort of ETL layer (which I had hoped to do someday myself) or schema helper, and moving stuff like dropTable in there as well.

ianmacl
Owner

IMO those sorts of manipulation methods belong in the JDatabaseDriver, not the JDatabaseImporter class, IMO. The importer methods will certainly use them, but shouldn't own them. In some cases you can't create, remove databases and tables without access to the underlying connection object which shouldn't be something that JDatabaseImporter has access to.

gpongelli

I added these methods to let installation phase works.
I did these changes for J2.5 , then I haven't followed subsequent joomla's changes.

I agree with Ian, the driver has to own all kinds of database's manipulation (tables, schema, etc); the other classes use the driver to perform their task without owning this code.
In my humble opinion this is a better solution for a logical point of view (who owns what) and for code clearness (piece of code exists at only one point).

Eng. Gabriele Pongelli.

elinw

It would be so helpful to have create database. The current importer is extremely limited and there is no sqlsrv support so just as a side consideration the idea of being able to create and actually potentially do a complete installation of an application including creating the database in the abstraction layer is very exciting.

Andrew Eddie

I'm going to close this because I really want to see database manipulation handled in another class.

gpongelli

Ok.
I did these changes to let CMS installs correctly on PostgreSQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Oct 21, 2012
gpongelli gpongelli Added some method inside JDatabaseDriver to create database and alter
character set for MySQL, MySQLi and PostgreSQL.
Added test too.
c5a0547
Oct 22, 2012
gpongelli gpongelli Changed @since tag. 0dac32e
This page is out of date. Refresh to see the latest.
95 libraries/joomla/database/driver.php
@@ -374,6 +374,27 @@ public function __construct($options)
374 374 }
375 375
376 376 /**
  377 + * Alter database's character set, obtaining query string from protected member.
  378 + *
  379 + * @param string $dbName The database name that will be altered
  380 + *
  381 + * @return string The query that alter the database query string
  382 + *
  383 + * @since 12.2
  384 + * @throws RuntimeException
  385 + */
  386 + public function alterDbCharacterSet($dbName)
  387 + {
  388 + if (is_null($dbName))
  389 + {
  390 + throw new RuntimeException('Database name must not be null.');
  391 + }
  392 +
  393 + $this->setQuery($this->getAlterDbCharacterSet($dbName));
  394 + return $this->execute();
  395 + }
  396 +
  397 + /**
377 398 * Connects to the database if needed.
378 399 *
379 400 * @return void Returns void if the database connected successfully.
@@ -393,6 +414,38 @@ public function __construct($options)
393 414 abstract public function connected();
394 415
395 416 /**
  417 + * Create a new database using information from $options object, obtaining query string
  418 + * from protected member.
  419 + *
  420 + * @param stdClass $options Object used to pass user and database name to database driver.
  421 + * This object must have "db_name" and "db_user" set.
  422 + * @param boolean $utf True if the database supports the UTF-8 character set.
  423 + *
  424 + * @return string The query that creates database
  425 + *
  426 + * @since 12.2
  427 + * @throws RuntimeException
  428 + */
  429 + public function createDatabase($options, $utf = true)
  430 + {
  431 + if (is_null($options))
  432 + {
  433 + throw new RuntimeException('$options object must not be null.');
  434 + }
  435 + elseif (empty($options->db_name))
  436 + {
  437 + throw new RuntimeException('$options object must have db_name set.');
  438 + }
  439 + elseif (empty($options->db_user))
  440 + {
  441 + throw new RuntimeException('$options object must have db_user set.');
  442 + }
  443 +
  444 + $this->setQuery($this->getCreateDatabaseQuery($options, $utf));
  445 + return $this->execute();
  446 + }
  447 +
  448 + /**
396 449 * Disconnects the database.
397 450 *
398 451 * @return void
@@ -481,6 +534,48 @@ public function __construct($options)
481 534 abstract public function getAffectedRows();
482 535
483 536 /**
  537 + * Return the query string to alter the database character set.
  538 + *
  539 + * @param string $dbName The database name
  540 + *
  541 + * @return string The query that alter the database query string
  542 + *
  543 + * @since 12.2
  544 + */
  545 + protected function getAlterDbCharacterSet($dbName)
  546 + {
  547 + $query = 'ALTER DATABASE ' . $this->quoteName($dbName) . ' CHARACTER SET `utf8`';
  548 +
  549 + return $query;
  550 + }
  551 +
  552 + /**
  553 + * Return the query string to create new Database.
  554 + * Each database driver, other than MySQL, need to override this member to return correct string.
  555 + *
  556 + * @param stdClass $options Object used to pass user and database name to database driver.
  557 + * This object must have "db_name" and "db_user" set.
  558 + * @param boolean $utf True if the database supports the UTF-8 character set.
  559 + *
  560 + * @return string The query that creates database
  561 + *
  562 + * @since 12.2
  563 + */
  564 + protected function getCreateDatabaseQuery($options, $utf)
  565 + {
  566 + if ($utf)
  567 + {
  568 + $query = 'CREATE DATABASE ' . $this->quoteName($options->db_name) . ' CHARACTER SET `utf8`';
  569 + }
  570 + else
  571 + {
  572 + $query = 'CREATE DATABASE ' . $this->quoteName($options->db_name);
  573 + }
  574 +
  575 + return $query;
  576 + }
  577 +
  578 + /**
484 579 * Method to get the database collation in use by sampling a text field of a table in the database.
485 580 *
486 581 * @return mixed The collation in use by the database or boolean false if not supported.
26 libraries/joomla/database/driver/postgresql.php
@@ -789,7 +789,7 @@ public function setUTF()
789 789 /**
790 790 * This function return a field value as a prepared string to be used in a SQL statement.
791 791 *
792   - * @param array $columns Array of table's column returned by ::getTableColumns.
  792 + * @param array &$columns Array of table's column returned by JDatabasePostgreSQL::getTableColumns.
793 793 * @param string $field_name The table field's name.
794 794 * @param string $field_value The variable value to quote and return.
795 795 *
@@ -797,7 +797,7 @@ public function setUTF()
797 797 *
798 798 * @since 11.3
799 799 */
800   - public function sqlValue($columns, $field_name, $field_value)
  800 + protected function sqlValue(&$columns, $field_name, $field_value)
801 801 {
802 802 switch ($columns[$field_name])
803 803 {
@@ -816,7 +816,6 @@ public function sqlValue($columns, $field_name, $field_value)
816 816 case 'bigserial':
817 817 case 'integer':
818 818 case 'money':
819   - case 'numeric':
820 819 case 'real':
821 820 case 'smallint':
822 821 case 'serial':
@@ -1094,15 +1093,15 @@ public function getRandom()
1094 1093 }
1095 1094
1096 1095 /**
1097   - * Get the query string to alter the database character set.
  1096 + * Return the query string to alter the database character set.
1098 1097 *
1099 1098 * @param string $dbName The database name
1100 1099 *
1101 1100 * @return string The query that alter the database query string
1102 1101 *
1103   - * @since 12.1
  1102 + * @since 12.2
1104 1103 */
1105   - public function getAlterDbCharacterSet( $dbName )
  1104 + protected function getAlterDbCharacterSet($dbName)
1106 1105 {
1107 1106 $query = 'ALTER DATABASE ' . $this->quoteName($dbName) . ' SET CLIENT_ENCODING TO ' . $this->quote('UTF8');
1108 1107
@@ -1110,18 +1109,17 @@ public function getAlterDbCharacterSet( $dbName )
1110 1109 }
1111 1110
1112 1111 /**
1113   - * Get the query string to create new Database in correct PostgreSQL syntax.
  1112 + * Return the query string to create new Database using PostgreSQL's syntax
1114 1113 *
1115   - * @param object $options object coming from "initialise" function to pass user
1116   - * and database name to database driver.
1117   - * @param boolean $utf True if the database supports the UTF-8 character set,
1118   - * not used in PostgreSQL "CREATE DATABASE" query.
  1114 + * @param stdClass $options Object used to pass user and database name to database driver.
  1115 + * This object must have "db_name" and "db_user" set.
  1116 + * @param boolean $utf True if the database supports the UTF-8 character set.
1119 1117 *
1120   - * @return string The query that creates database, owned by $options['user']
  1118 + * @return string The query that creates database, owned by $options['user']
1121 1119 *
1122   - * @since 12.1
  1120 + * @since 12.3
1123 1121 */
1124   - public function getCreateDbQuery($options, $utf)
  1122 + protected function getCreateDatabaseQuery($options, $utf)
1125 1123 {
1126 1124 $query = 'CREATE DATABASE ' . $this->quoteName($options->db_name) . ' OWNER ' . $this->quoteName($options->db_user);
1127 1125
79 tests/suites/database/driver/mysql/JDatabaseMySQLTest.php
@@ -17,6 +17,22 @@
17 17 class JDatabaseMysqlTest extends TestCaseDatabaseMysql
18 18 {
19 19 /**
  20 + * Data for the getCreateDbQuery test.
  21 + *
  22 + * @return array
  23 + *
  24 + * @since 12.3
  25 + */
  26 + public function dataGetCreateDbQuery()
  27 + {
  28 + $obj = new stdClass;
  29 + $obj->db_user = 'testName';
  30 + $obj->db_name = 'testDb';
  31 +
  32 + return array(array($obj, false), array($obj, true));
  33 + }
  34 +
  35 + /**
20 36 * Data for the testEscape test.
21 37 *
22 38 * @return array
@@ -44,6 +60,18 @@ public function test__destruct()
44 60 }
45 61
46 62 /**
  63 + * Test alterDbCharacterSet with null param.
  64 + *
  65 + * @return void
  66 + *
  67 + * @expectedException RuntimeException
  68 + */
  69 + public function testAlterDbCharacterSet()
  70 + {
  71 + self::$driver->alterDbCharacterSet(null);
  72 + }
  73 +
  74 + /**
47 75 * Tests the connected method.
48 76 *
49 77 * @return void
@@ -56,6 +84,18 @@ public function testConnected()
56 84 }
57 85
58 86 /**
  87 + * Test createDatabase with null param.
  88 + *
  89 + * @return void
  90 + *
  91 + * @expectedException RuntimeException
  92 + */
  93 + public function testCreateDatabase()
  94 + {
  95 + self::$driver->createDatabase(null);
  96 + }
  97 +
  98 + /**
59 99 * Tests the dropTable method.
60 100 *
61 101 * @return void
@@ -104,6 +144,20 @@ public function testGetAffectedRows()
104 144 }
105 145
106 146 /**
  147 + * Tests the JDatabaseMysql getAlterDbCharacterSet method.
  148 + *
  149 + * @return void
  150 + */
  151 + public function testGetAlterDbCharacterSet()
  152 + {
  153 + $expected = 'ALTER DATABASE ' . self::$driver->quoteName('test') . ' CHARACTER SET ' . self::$driver->quote('utf8');
  154 +
  155 + $result = TestReflection::invoke(self::$driver, 'getAlterDbCharacterSet', 'test');
  156 +
  157 + $this->assertThat($result, $this->equalTo($expected), __LINE__);
  158 + }
  159 +
  160 + /**
107 161 * Test getCollation method.
108 162 *
109 163 * @return void
@@ -116,6 +170,31 @@ public function testGetCollation()
116 170 }
117 171
118 172 /**
  173 + * Tests the JDatabaseMysqli getCreateDbQuery method.
  174 + *
  175 + * @param stdClass $options Object used to pass user and database name to database driver.
  176 + * This object must have "db_name" and "db_user" set.
  177 + * @param boolean $utf True if the database supports the UTF-8 character set.
  178 + *
  179 + * @return void
  180 + *
  181 + * @dataProvider dataGetCreateDbQuery
  182 + */
  183 + public function testGetCreateDatabaseQuery($options, $utf)
  184 + {
  185 + $expected = 'CREATE DATABASE ' . self::$driver->quoteName($options->db_name);
  186 +
  187 + if ($utf)
  188 + {
  189 + $expected .= ' CHARACTER SET ' . self::$driver->quote('utf8');
  190 + }
  191 +
  192 + $result = TestReflection::invoke(self::$driver, 'getCreateDatabaseQuery', $options, $utf);
  193 +
  194 + $this->assertThat($result, $this->equalTo($expected), __LINE__);
  195 + }
  196 +
  197 + /**
119 198 * Test getExporter method.
120 199 *
121 200 * @return void
79 tests/suites/database/driver/mysqli/JDatabaseMySQLiTest.php
@@ -17,6 +17,22 @@
17 17 class JDatabaseMysqliTest extends TestCaseDatabaseMysqli
18 18 {
19 19 /**
  20 + * Data for the getCreateDbQuery test.
  21 + *
  22 + * @return array
  23 + *
  24 + * @since 12.3
  25 + */
  26 + public function dataGetCreateDbQuery()
  27 + {
  28 + $obj = new stdClass;
  29 + $obj->db_user = 'testName';
  30 + $obj->db_name = 'testDb';
  31 +
  32 + return array(array($obj, false), array($obj, true));
  33 + }
  34 +
  35 + /**
20 36 * Data for the testEscape test.
21 37 *
22 38 * @return array
@@ -44,6 +60,18 @@ public function test__destruct()
44 60 }
45 61
46 62 /**
  63 + * Test alterDbCharacterSet with null param.
  64 + *
  65 + * @return void
  66 + *
  67 + * @expectedException RuntimeException
  68 + */
  69 + public function testAlterDbCharacterSet()
  70 + {
  71 + self::$driver->alterDbCharacterSet(null);
  72 + }
  73 +
  74 + /**
47 75 * Test connected method.
48 76 *
49 77 * @return void
@@ -56,6 +84,18 @@ public function testConnected()
56 84 }
57 85
58 86 /**
  87 + * Test createDatabase with null param.
  88 + *
  89 + * @return void
  90 + *
  91 + * @expectedException RuntimeException
  92 + */
  93 + public function testCreateDatabase()
  94 + {
  95 + self::$driver->createDatabase(null);
  96 + }
  97 +
  98 + /**
59 99 * Tests the dropTable method.
60 100 *
61 101 * @return void
@@ -104,6 +144,45 @@ public function testGetAffectedRows()
104 144 }
105 145
106 146 /**
  147 + * Tests the JDatabaseMysqli getAlterDbCharacterSet method.
  148 + *
  149 + * @return void
  150 + */
  151 + public function testGetAlterDbCharacterSet()
  152 + {
  153 + $expected = 'ALTER DATABASE ' . self::$driver->quoteName('test') . ' CHARACTER SET ' . self::$driver->quote('utf8');
  154 +
  155 + $result = TestReflection::invoke(self::$driver, 'getAlterDbCharacterSet', 'test');
  156 +
  157 + $this->assertThat($result, $this->equalTo($expected), __LINE__);
  158 + }
  159 +
  160 + /**
  161 + * Tests the JDatabaseMysqli getCreateDbQuery method.
  162 + *
  163 + * @param stdClass $options Object used to pass user and database name to database driver.
  164 + * This object must have "db_name" and "db_user" set.
  165 + * @param boolean $utf True if the database supports the UTF-8 character set.
  166 + *
  167 + * @return void
  168 + *
  169 + * @dataProvider dataGetCreateDbQuery
  170 + */
  171 + public function testGetCreateDatabaseQuery($options, $utf)
  172 + {
  173 + $expected = 'CREATE DATABASE ' . self::$driver->quoteName($options->db_name);
  174 +
  175 + if ($utf)
  176 + {
  177 + $expected .= ' CHARACTER SET ' . self::$driver->quote('utf8');
  178 + }
  179 +
  180 + $result = TestReflection::invoke(self::$driver, 'getCreateDatabaseQuery', $options, $utf);
  181 +
  182 + $this->assertThat($result, $this->equalTo($expected), __LINE__);
  183 + }
  184 +
  185 + /**
107 186 * Test getExporter method.
108 187 *
109 188 * @return void
149 tests/suites/database/driver/postgresql/JDatabasePostgresqlTest.php
@@ -225,6 +225,18 @@ public function test__destruct()
225 225 }
226 226
227 227 /**
  228 + * Test alterDbCharacterSet with null param.
  229 + *
  230 + * @return void
  231 + *
  232 + * @expectedException RuntimeException
  233 + */
  234 + public function testAlterDbCharacterSet()
  235 + {
  236 + self::$driver->alterDbCharacterSet(null);
  237 + }
  238 +
  239 + /**
228 240 * Check if connected() method returns true.
229 241 *
230 242 * @return void
@@ -235,6 +247,63 @@ public function testConnected()
235 247 }
236 248
237 249 /**
  250 + * Test createDatabase with null param.
  251 + *
  252 + * @return void
  253 + *
  254 + * @expectedException RuntimeException
  255 + */
  256 + public function testCreateDatabase()
  257 + {
  258 + self::$driver->createDatabase(null);
  259 + }
  260 +
  261 + /**
  262 + * Test createDatabase with null database's name.
  263 + *
  264 + * @return void
  265 + *
  266 + * @expectedException RuntimeException
  267 + */
  268 + public function testCreateDatabase_nullDbName()
  269 + {
  270 + $obj = new stdClass;
  271 + $obj->db_user = 'test';
  272 +
  273 + self::$driver->createDatabase($obj);
  274 + }
  275 +
  276 + /**
  277 + * Test createDatabase with null user's name.
  278 + *
  279 + * @return void
  280 + *
  281 + * @expectedException RuntimeException
  282 + */
  283 + public function testCreateDatabase_nullUserName()
  284 + {
  285 + $obj = new stdClass;
  286 + $obj->db_name = 'test';
  287 +
  288 + self::$driver->createDatabase($obj);
  289 + }
  290 +
  291 + /**
  292 + * Test createDatabase with empty user's name.
  293 + *
  294 + * @return void
  295 + *
  296 + * @expectedException RuntimeException
  297 + */
  298 + public function testCreateDatabase_emptyUserName()
  299 + {
  300 + $obj = new stdClass;
  301 + $obj->db_name = '';
  302 +
  303 + self::$driver->createDatabase($obj);
  304 + }
  305 +
  306 + /**
238 307 * Tests the JDatabasePostgresql escape method.
239 308 *
240 309 * @param string $text The string to be escaped.
@@ -271,6 +340,45 @@ public function testGetAffectedRows()
271 340 }
272 341
273 342 /**
  343 + * Tests the JDatabasePostgresql getCreateDbQuery method.
  344 + *
  345 + * @param stdClass $options Object used to pass user and database name to database driver.
  346 + * This object must have "db_name" and "db_user" set.
  347 + * @param boolean $utf True if the database supports the UTF-8 character set.
  348 + *
  349 + * @return void
  350 + *
  351 + * @dataProvider dataGetCreateDbQuery
  352 + */
  353 + public function testGetCreateDatabaseQuery($options, $utf)
  354 + {
  355 + $expected = 'CREATE DATABASE ' . self::$driver->quoteName($options->db_name) . ' OWNER ' . self::$driver->quoteName($options->db_user);
  356 +
  357 + if ($utf)
  358 + {
  359 + $expected .= ' ENCODING ' . self::$driver->quote('UTF-8');
  360 + }
  361 +
  362 + $result = TestReflection::invoke(self::$driver, 'getCreateDatabaseQuery', $options, $utf);
  363 +
  364 + $this->assertThat($result, $this->equalTo($expected), __LINE__);
  365 + }
  366 +
  367 + /**
  368 + * Tests the JDatabasePostgresql getAlterDbCharacterSet method.
  369 + *
  370 + * @return void
  371 + */
  372 + public function testGetAlterDbCharacterSet()
  373 + {
  374 + $expected = 'ALTER DATABASE ' . self::$driver->quoteName('test') . ' SET CLIENT_ENCODING TO ' . self::$driver->quote('UTF8');
  375 +
  376 + $result = TestReflection::invoke(self::$driver, 'getAlterDbCharacterSet', 'test');
  377 +
  378 + $this->assertThat($result, $this->equalTo($expected), __LINE__);
  379 + }
  380 +
  381 + /**
274 382 * Tests the JDatabasePostgresql getCollation method.
275 383 *
276 384 * @return void
@@ -1071,7 +1179,7 @@ public function testSqlValue()
1071 1179
1072 1180 foreach (get_object_vars($tst) as $key => $val)
1073 1181 {
1074   - $values[] = self::$driver->sqlValue($tablCol, $key, $val);
  1182 + $values[] = TestReflection::invoke(self::$driver, 'sqlValue', $tablCol, $key, $val);
1075 1183 }
1076 1184
1077 1185 $this->assertThat(
@@ -1346,43 +1454,4 @@ public function testTransactionSavepoint( /*$savepointName*/ )
1346 1454 {
1347 1455 $this->markTestSkipped('This command is tested inside testTransactionRollback.');
1348 1456 }
1349   -
1350   - /**
1351   - * Tests the JDatabasePostgresql getCreateDbQuery method.
1352   - *
1353   - * @param JObject $options JObject coming from "initialise" function to pass user
1354   - * and database name to database driver.
1355   - * @param boolean $utf True if the database supports the UTF-8 character set.
1356   - *
1357   - * @return void
1358   - *
1359   - * @dataProvider dataGetCreateDbQuery
1360   - */
1361   - public function testGetCreateDbQuery($options, $utf)
1362   - {
1363   - $expected = 'CREATE DATABASE ' . self::$driver->quoteName($options->db_name) . ' OWNER ' . self::$driver->quoteName($options->db_user);
1364   -
1365   - if ($utf)
1366   - {
1367   - $expected .= ' ENCODING ' . self::$driver->quote('UTF-8');
1368   - }
1369   -
1370   - $result = self::$driver->getCreateDbQuery($options, $utf);
1371   -
1372   - $this->assertThat($result, $this->equalTo($expected), __LINE__);
1373   - }
1374   -
1375   - /**
1376   - * Tests the JDatabasePostgresql getAlterDbCharacterSet method.
1377   - *
1378   - * @return void
1379   - */
1380   - public function testGetAlterDbCharacterSet()
1381   - {
1382   - $expected = 'ALTER DATABASE ' . self::$driver->quoteName('test') . ' SET CLIENT_ENCODING TO ' . self::$driver->quote('UTF8');
1383   -
1384   - $result = self::$driver->getAlterDbCharacterSet('test');
1385   -
1386   - $this->assertThat($result, $this->equalTo($expected), __LINE__);
1387   - }
1388 1457 }

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.