follow up r60916 - Use getType instead of instanceOf as suggested by Simetrical
authorMark A. Hershberger <mah@users.mediawiki.org>
Mon, 11 Jan 2010 04:00:03 +0000 (04:00 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Mon, 11 Jan 2010 04:00:03 +0000 (04:00 +0000)
tests/DatabaseTest.php

index 37f73e8..aa50de2 100644 (file)
@@ -9,7 +9,7 @@ class DatabaseTest extends PHPUnit_Framework_TestCase {
 
        function testAddQuotesNull() {
                $check = "NULL";
-               if ( $this->db instanceOf DatabaseSqlite ) {
+               if ( $this->db->getType() === 'sqlite' ) {
                        $check = "''";
                }
                $this->assertEquals( $check, $this->db->addQuotes( null ) );
@@ -38,7 +38,7 @@ class DatabaseTest extends PHPUnit_Framework_TestCase {
 
        function testAddQuotesStringQuote() {
                $check = "'string''s cause trouble'";
-               if ( $this->db instanceOf DatabaseMysql ) {
+               if ( $this->db->getType() === 'mysql' ) {
                        $check = "'string\'s cause trouble'";
                }
                $this->assertEquals(
@@ -60,7 +60,7 @@ class DatabaseTest extends PHPUnit_Framework_TestCase {
                        array( 4, "Snicker's_paradox" ) );
 
                $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker''s_paradox'";
-               if ( $this->db instanceOf DatabaseMysql ) {
+               if ( $this->db->getType() === 'mysql' ) {
                        $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker\'s_paradox'";
                }
                $this->assertEquals( $check, $sql );
@@ -72,7 +72,7 @@ class DatabaseTest extends PHPUnit_Framework_TestCase {
                        array( '"user"', "Slash's Dot" ) );
 
                $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash''s Dot'";
-               if ( $this->db instanceOf DatabaseMysql ) {
+               if ( $this->db->getType() === 'mysql' ) {
                        $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash\'s Dot'";
                }
                $this->assertEquals( $check, $sql );