use OCP\IDb;
use OCP\IDBConnection;
use OCP\PreConditionNotMetException;
+use Doctrine\DBAL\Platforms\MySqlPlatform;
/**
* @deprecated use IDBConnection directly, will be removed in ownCloud 10
public function escapeLikeParameter($param) {
return $this->connection->escapeLikeParameter($param);
}
+
+ /**
+ * Check whether or not the current database support 4byte wide unicode
+ *
+ * @return bool
+ * @since 9.2.0
+ */
+ public function supports4ByteText() {
+ return $this->connection->supports4ByteText();
+ }
}
use OC\Files\Storage\Local;
use OC\Files\View;
+use OCP\Files\InvalidPathException;
/**
* Class PathVerificationTest
/**
* @dataProvider providesAstralPlane
- * @expectedException \OCP\Files\InvalidPathException
- * @expectedExceptionMessage 4-byte characters are not supported in file names
*/
public function testPathVerificationAstralPlane($fileName) {
+ $connection = \OC::$server->getDatabaseConnection();
+
+ if (!$connection->supports4ByteText()) {
+ $this->expectException(InvalidPathException::class);
+ $this->expectExceptionMessage('4-byte characters are not supported in file names');
+ }
+
$this->view->verifyPath('', $fileName);
}