From da3004b8f5f6f96f817568c5cba002540d61150b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 17 Nov 2017 15:48:10 +0100 Subject: add postgresql10 compatibility to dbal Signed-off-by: Robin Appelman --- tests/lib/DB/OCPostgreSqlPlatformTest.php | 35 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'tests/lib/DB') 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 * */ - + 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, ]); } - + } -- cgit v1.2.3