instead of alterning focus between the two buttons.
* (bug 24987) Special:ListUsers does not take external groups into account
* (bug 20633) update.php has mixed language output
+* SQLite system table names are now never prefixed.
=== API changes in 1.17 ===
* (bug 22738) Allow filtering by action type on query=logevent.
* Use MySQL's naming (accounts for prefix etc) but remove surrounding backticks
*/
function tableName( $name ) {
+ // table names starting with sqlite_ are reserved
+ if ( strpos( $name, 'sqlite_' ) === 0 ) return $name;
return str_replace( '`', '', parent::tableName( $name ) );
}
}
}
+/**
+ * @group sqlite
+ */
class DatabaseSqliteTest extends PHPUnit_Framework_TestCase {
var $db;
- function setup() {
+ public function setup() {
if ( !Sqlite::isPresent() ) {
$this->markTestSkipped( 'No SQLite support detected' );
}
$this->db = new MockDatabaseSqlite();
}
- function replaceVars( $sql ) {
+ private function replaceVars( $sql ) {
// normalize spacing to hide implementation details
return preg_replace( '/\s+/', ' ', $this->db->replaceVars( $sql ) );
}
- function testReplaceVars() {
+ public function testReplaceVars() {
$this->assertEquals( 'foo', $this->replaceVars( 'foo' ), "Don't break anything accidentally" );
$this->assertEquals( "CREATE TABLE /**/foo (foo_key INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "
$this->replaceVars( "ALTER TABLE foo\nADD COLUMN foo_bar int(10) unsigned DEFAULT 42" )
);
}
+
+ public function testTableName() {
+ // @todo Moar!
+ $db = new DatabaseSqliteStandalone( ':memory:' );
+ $this->assertEquals( 'foo', $db->tableName( 'foo' ) );
+ $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) );
+ $db->tablePrefix( 'foo' );
+ $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) );
+ $this->assertEquals( 'foobar', $db->tableName( 'bar' ) );
+ }
function testEntireSchema() {
global $IP;
$this->fail( $result );
}
}
-}
\ No newline at end of file
+}