summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-30 10:57:16 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-03-21 16:42:12 -0600
commit713f684a8b543050c6107e65dcf65a0e1566914c (patch)
treef47d453233417dc7cbe03b318d91ed0995afa64f /tests
parentd2b1b0224437e521094dd251bc84bc93d1e338b1 (diff)
downloadnextcloud-server-713f684a8b543050c6107e65dcf65a0e1566914c.tar.gz
nextcloud-server-713f684a8b543050c6107e65dcf65a0e1566914c.zip
Adding tests for 4 byte unicode characters
* success on SQLite and Postgres * failure on MySQL due to the limited charset that only supports up to 3 bytes Add config option to update charset of mysql to utf8mb4 * fully optional * requires additional options set in the database only disable unicode test on mysql Fixing ctor call Adding docker based unit test execution for mysql utf8mb4 Add mysqlmb4 test configuration to Jenkinsfile fix collation on utf8mb4 Properly setup charset and collation in the doctrine connection Allow files containing 4-byte chars in case the database supports it During setup of a mysql database we try to detect if charset 'utf8mb4' can be used Fix mysql settings Add console command to migrate the charset Set ROW_FORMAT before setting collation to mb4 Also select tables with wrong collation Faster MySQL docker Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/DB/MDB2SchemaReaderTest.php2
-rw-r--r--tests/lib/DB/SchemaDiffTest.php4
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/lib/DB/MDB2SchemaReaderTest.php b/tests/lib/DB/MDB2SchemaReaderTest.php
index dcec6ae593e..3daf0dd7589 100644
--- a/tests/lib/DB/MDB2SchemaReaderTest.php
+++ b/tests/lib/DB/MDB2SchemaReaderTest.php
@@ -47,7 +47,7 @@ class MDB2SchemaReaderTest extends TestCase {
public function testRead() {
$reader = new MDB2SchemaReader($this->getConfig(), new MySqlPlatform());
- $schema = $reader->loadSchemaFromFile(__DIR__ . '/testschema.xml');
+ $schema = $reader->loadSchemaFromFile(__DIR__ . '/testschema.xml', new Schema());
$this->assertCount(1, $schema->getTables());
$table = $schema->getTable('test_table');
diff --git a/tests/lib/DB/SchemaDiffTest.php b/tests/lib/DB/SchemaDiffTest.php
index 88c9abeb431..f74d800bfec 100644
--- a/tests/lib/DB/SchemaDiffTest.php
+++ b/tests/lib/DB/SchemaDiffTest.php
@@ -21,6 +21,7 @@
namespace Test\DB;
+use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaDiff;
use OC\DB\MDB2SchemaManager;
use OC\DB\MDB2SchemaReader;
@@ -79,7 +80,8 @@ class SchemaDiffTest extends TestCase {
$this->manager->createDbFromStructure($schemaFile);
$schemaReader = new MDB2SchemaReader($this->config, $this->connection->getDatabasePlatform());
- $endSchema = $schemaReader->loadSchemaFromFile($schemaFile);
+ $toSchema = new Schema([], [], $this->connection->getSchemaManager()->createSchemaConfig());
+ $endSchema = $schemaReader->loadSchemaFromFile($schemaFile, $toSchema);
// get the diff
/** @var SchemaDiff $diff */