Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F9366
testormrowtest.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 22 2014, 12:24 AM
2014-11-22 00:24:07 (UTC+0)
Size
3 KB
Referenced Files
None
Subscribers
None
testormrowtest.patch
View Options
diff --git a/tests/phpunit/includes/db/TestORMRowTest.php b/tests/phpunit/includes/db/TestORMRowTest.php
index afd1cb8..bb8f14b 100644
--- a/tests/phpunit/includes/db/TestORMRowTest.php
+++ b/tests/phpunit/includes/db/TestORMRowTest.php
@@ -63,23 +63,46 @@ class TestORMRowTest extends ORMRowTest {
$dbw = wfGetDB( DB_MASTER );
- $isSqlite = $GLOBALS['wgDBtype'] === 'sqlite';
-
- $idField = $isSqlite ? 'INTEGER' : 'INT unsigned';
- $primaryKey = $isSqlite ? 'PRIMARY KEY AUTOINCREMENT' : 'auto_increment PRIMARY KEY';
-
- $dbw->query(
- 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '(
- test_id ' . $idField . ' NOT NULL ' . $primaryKey . ',
- test_name VARCHAR(255) NOT NULL,
- test_age TINYINT unsigned NOT NULL,
- test_height FLOAT NOT NULL,
- test_awesome TINYINT unsigned NOT NULL,
- test_stuff BLOB NOT NULL,
- test_moarstuff BLOB NOT NULL,
- test_time varbinary(14) NOT NULL
- );'
- );
+ if ( $GLOBALS['wgDBtype'] === 'postgres' ) {
+ $dbw->query(
+ 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '(
+ test_id SERIAL NOT NULL PRIMARY KEY,
+ test_name VARCHAR(255) NOT NULL,
+ test_age SMALLINT NOT NULL,
+ test_height FLOAT NOT NULL,
+ test_awesome SMALLINT NOT NULL,
+ test_stuff BYTEA NOT NULL,
+ test_moarstuff BYTEA NOT NULL,
+ test_time BYTEA NOT NULL
+ );'
+ );
+ } elseif ( $GLOBALS['wgDBtype'] === 'sqlite' ) {
+ $dbw->query(
+ 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '(
+ test_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ test_name VARCHAR(255) NOT NULL,
+ test_age TINYINT unsigned NOT NULL,
+ test_height FLOAT NOT NULL,
+ test_awesome TINYINT unsigned NOT NULL,
+ test_stuff BLOB NOT NULL,
+ test_moarstuff BLOB NOT NULL,
+ test_time varbinary(14) NOT NULL
+ );'
+ );
+ } else {
+ $dbw->query(
+ 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '(
+ test_id INT unsigned NOT NULL auto_increment PRIMARY KEY,
+ test_name VARCHAR(255) NOT NULL,
+ test_age TINYINT unsigned NOT NULL,
+ test_height FLOAT NOT NULL,
+ test_awesome TINYINT unsigned NOT NULL,
+ test_stuff BLOB NOT NULL,
+ test_moarstuff BLOB NOT NULL,
+ test_time varbinary(14) NOT NULL
+ );'
+ );
+ }
}
public function constructorTestProvider() {
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8870
Default Alt Text
testormrowtest.patch (3 KB)
Attached To
Mode
T39601: Tests introduced in tests/phpunit/includes/db/TestORMRowTest.php fail on PostgreSQL
Attached
Detach File
Event Timeline
Log In to Comment