r60918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60917‎ | r60918 | r60919 >
Date:04:00, 11 January 2010
Author:mah
Status:ok
Tags:
Comment:
follow up r60916 - Use getType instead of instanceOf as suggested by Simetrical
Modified paths:
  • /trunk/phase3/tests/DatabaseTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/DatabaseTest.php
@@ -9,7 +9,7 @@
1010
1111 function testAddQuotesNull() {
1212 $check = "NULL";
13 - if ( $this->db instanceOf DatabaseSqlite ) {
 13+ if ( $this->db->getType() === 'sqlite' ) {
1414 $check = "''";
1515 }
1616 $this->assertEquals( $check, $this->db->addQuotes( null ) );
@@ -38,7 +38,7 @@
3939
4040 function testAddQuotesStringQuote() {
4141 $check = "'string''s cause trouble'";
42 - if ( $this->db instanceOf DatabaseMysql ) {
 42+ if ( $this->db->getType() === 'mysql' ) {
4343 $check = "'string\'s cause trouble'";
4444 }
4545 $this->assertEquals(
@@ -60,7 +60,7 @@
6161 array( 4, "Snicker's_paradox" ) );
6262
6363 $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker''s_paradox'";
64 - if ( $this->db instanceOf DatabaseMysql ) {
 64+ if ( $this->db->getType() === 'mysql' ) {
6565 $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker\'s_paradox'";
6666 }
6767 $this->assertEquals( $check, $sql );
@@ -72,7 +72,7 @@
7373 array( '"user"', "Slash's Dot" ) );
7474
7575 $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash''s Dot'";
76 - if ( $this->db instanceOf DatabaseMysql ) {
 76+ if ( $this->db->getType() === 'mysql' ) {
7777 $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash\'s Dot'";
7878 }
7979 $this->assertEquals( $check, $sql );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60916fix up db tests so they work withs DBs besides just MySQL. Make tests run un...mah02:49, 11 January 2010

Status & tagging log