summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-27 16:40:58 +0100
committerGitHub <noreply@github.com>2017-11-27 16:40:58 +0100
commit4a63727ed989818eaca85dea113e8e0b075b1c07 (patch)
tree667f2e981f218866ef1df03b5d63e99ecef37d1b /tests/lib
parente428ef9d75d8b6ffe92bc9335f587fd934c10bc8 (diff)
parentb331c67859cee479713d5c223d3aaa4b5c9c6792 (diff)
downloadnextcloud-server-4a63727ed989818eaca85dea113e8e0b075b1c07.tar.gz
nextcloud-server-4a63727ed989818eaca85dea113e8e0b075b1c07.zip
Merge pull request #7210 from nextcloud/pg10
add postgresql 10 compatibility to dbal
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/DB/OCPostgreSqlPlatformTest.php35
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,
]);
}
-
+
}