diff options
author | Robin Appelman <robin@icewind.nl> | 2017-11-17 15:48:10 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-11-22 17:57:17 +0100 |
commit | da3004b8f5f6f96f817568c5cba002540d61150b (patch) | |
tree | 5d342d5d67434c960765c36fe187989a264fe2f8 /tests/lib/DB | |
parent | f347e2e4a6cab71c35d58ff21692e23d7443db60 (diff) | |
download | nextcloud-server-da3004b8f5f6f96f817568c5cba002540d61150b.tar.gz nextcloud-server-da3004b8f5f6f96f817568c5cba002540d61150b.zip |
add postgresql10 compatibility to dbal
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/DB')
-rw-r--r-- | tests/lib/DB/OCPostgreSqlPlatformTest.php | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/tests/lib/DB/OCPostgreSqlPlatformTest.php b/tests/lib/DB/OCPostgreSqlPlatformTest.php index 56fab621cfc..54701bdcec9 100644 --- a/tests/lib/DB/OCPostgreSqlPlatformTest.php +++ b/tests/lib/DB/OCPostgreSqlPlatformTest.php @@ -18,33 +18,34 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ - + namespace Test\DB; +use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Schema; -use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\Type; -use OC\DB\OCPostgreSqlPlatform; - - /** + +/** * Class OCPostgreSqlPlatformTest * + * custom OCPostgreSqlPlatform behavior has been upstreamed, test is left to + * ensure behavior stays correct. + * * @group DB * * @package Test\DB */ - class OCPostgreSqlPlatformTest extends \Test\TestCase { - public function testAlterBigint(){ - $platform = new OCPostgreSqlPlatform(); + public function testAlterBigint() { + $platform = new PostgreSqlPlatform(); $sourceSchema = new Schema(); $targetSchema = new Schema(); - + $this->createTableAndColumn($sourceSchema, Type::INTEGER); $this->createTableAndColumn($targetSchema, Type::BIGINT); - + $comparator = new Comparator(); $diff = $comparator->compare($sourceSchema, $targetSchema); $sqlStatements = $diff->toSql($platform); @@ -53,22 +54,22 @@ class OCPostgreSqlPlatformTest extends \Test\TestCase { $sqlStatements, true ); - + $this->assertNotContains( 'ALTER TABLE poor_yorick ALTER id DROP DEFAULT', $sqlStatements, true ); } - - protected function createTableAndColumn($schema, $type){ + + protected function createTableAndColumn($schema, $type) { $table = $schema->createTable("poor_yorick"); $table->addColumn('id', $type, [ 'autoincrement' => true, - 'unsigned' => true, - 'notnull' => true, - 'length' => 11, + 'unsigned' => true, + 'notnull' => true, + 'length' => 11, ]); } - + } |