diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-10-23 14:32:37 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-10-23 14:35:44 +0200 |
commit | 5aab98c4bf1904f9886c4fe091546f9edab1fb4d (patch) | |
tree | 4052c0456a5bdc195e9287b440cd0f9d9975ba3a /tests/lib/dbschema.php | |
parent | 770f643e5cf78493dde576f85fee9c4b66a31f38 (diff) | |
download | nextcloud-server-5aab98c4bf1904f9886c4fe091546f9edab1fb4d.tar.gz nextcloud-server-5aab98c4bf1904f9886c4fe091546f9edab1fb4d.zip |
disable database migration unit tests for MSSQL
Diffstat (limited to 'tests/lib/dbschema.php')
-rw-r--r-- | tests/lib/dbschema.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/lib/dbschema.php b/tests/lib/dbschema.php index c07e32a404e..d31bd34124e 100644 --- a/tests/lib/dbschema.php +++ b/tests/lib/dbschema.php @@ -1,4 +1,5 @@ <?php + /** * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> * This file is licensed under the Affero General Public License version 3 or @@ -6,6 +7,8 @@ * See the COPYING-README file. */ +use OCP\Security\ISecureRandom; + class Test_DBSchema extends PHPUnit_Framework_TestCase { protected $schema_file = 'static://test_db_scheme'; protected $schema_file2 = 'static://test_db_scheme2'; @@ -16,7 +19,8 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase { $dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml'; $dbfile2 = OC::$SERVERROOT.'/tests/data/db_structure2.xml'; - $r = '_'.OC_Util::generateRandomBytes(4).'_'; + $r = '_' . \OC::$server->getSecureRandom()->getMediumStrengthGenerator()-> + generate(4, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS) . '_'; $content = file_get_contents( $dbfile ); $content = str_replace( '*dbprefix*', '*dbprefix*'.$r, $content ); file_put_contents( $this->schema_file, $content ); @@ -38,6 +42,10 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase { * @medium */ public function testSchema() { + $platform = \OC_DB::getConnection()->getDatabasePlatform(); + if ($platform instanceof \Doctrine\DBAL\Platforms\SQLServerPlatform) { + $this->markTestSkipped("Test not relevant on MSSQL"); + } $this->doTestSchemaCreating(); $this->doTestSchemaChanging(); $this->doTestSchemaDumping(); @@ -80,8 +88,8 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase { * @param string $table */ public function assertTableNotExist($table) { - $type=OC_Config::getValue( "dbtype", "sqlite" ); - if( $type == 'sqlite' || $type == 'sqlite3' ) { + $platform = \OC_DB::getConnection()->getDatabasePlatform(); + if ($platform instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) { // sqlite removes the tables after closing the DB $this->assertTrue(true); } else { |