Skip to content

Commit

Permalink
only disable unicode test on mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
MorrisJobke authored and DeepDiver1975 committed Nov 12, 2015
1 parent be54d22 commit c797162
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/lib/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,25 +391,29 @@ public function testILIKEWildcard() {
/**
* @dataProvider insertAndSelectDataProvider
*/
public function testInsertAndSelectData($expected) {
public function testInsertAndSelectData($expected, $skipOnMysql) {
$table = "*PREFIX*{$this->text_table}";

$query = OC_DB::prepare("INSERT INTO `$table` (`textfield`) VALUES (?)");
$result = $query->execute(array($expected));
$this->assertEquals(1, $result);

$actual = OC_DB::prepare("SELECT `textfield` FROM `$table`")->execute()->fetchOne();
$config = \OC::$server->getConfig();
if($skipOnMysql && $config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false) === false) {
return;
}
$this->assertSame($expected, $actual);
}

public function insertAndSelectDataProvider() {
return [
['abcdefghijklmnopqrstuvwxyzABCDEFGHIKLMNOPQRSTUVWXYZ'],
['0123456789'],
['äöüÄÖÜß!"§$%&/()=?#\'+*~°^`´'],
['²³¼½¬{[]}\\'],
['♡⚗'],
['💩'], # :hankey: on github
['abcdefghijklmnopqrstuvwxyzABCDEFGHIKLMNOPQRSTUVWXYZ', false],
['0123456789', false],
['äöüÄÖÜß!"§$%&/()=?#\'+*~°^`´', false],
['²³¼½¬{[]}\\', false],
['♡⚗', false],
['💩', true], # :hankey: on github
];
}
}

0 comments on commit c797162

Please sign in to comment.