diff options
author | Vitor Mattos <vitor@php.rio> | 2022-01-12 19:31:38 +0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-01-21 14:37:07 +0300 |
commit | 52affa9ddd422fec22c4275b307fc87e5f91059f (patch) | |
tree | aed5cf42ec7e3ee65aace6332f996112ac96450f /tests | |
parent | b845042a67586938764b0495d5a28ba86f68c2f2 (diff) |
Skip if dont support 4 bytes UTF8
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Comments/ManagerTest.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php index a0033011cb5..e588630a483 100644 --- a/tests/lib/Comments/ManagerTest.php +++ b/tests/lib/Comments/ManagerTest.php @@ -2,6 +2,7 @@ namespace Test\Comments; +use Doctrine\DBAL\Platforms\MySQLPlatform; use OC\Comments\Comment; use OC\Comments\Manager; use OCP\AppFramework\Utility\ITimeFactory; @@ -874,12 +875,21 @@ class ManagerTest extends TestCase { $this->assertTrue(is_string($manager->resolveDisplayName('planet', 'neptune'))); } + private function skipIfNotSupport4ByteUTF() { + // 4 byte UTF doesn't work on mysql + $params = \OC::$server->get(\OC\DB\Connection::class)->getParams(); + if (\OC::$server->getDatabaseConnection()->getDatabasePlatform() instanceof MySQLPlatform && $params['charset'] !== 'utf8mb4') { + $this->markTestSkipped('MySQL doesn\'t support 4 byte UTF-8'); + } + } + /** * @dataProvider providerTestReactionAddAndDelete * * @return void */ public function testReactionAddAndDelete(array $comments, array $reactionsExpected) { + $this->skipIfNotSupport4ByteUTF(); $manager = $this->getManager(); $buffer = []; foreach ($comments as $commentData) { @@ -964,6 +974,7 @@ class ManagerTest extends TestCase { * @dataProvider providerTestRetrieveAllReactions */ public function testRetrieveAllReactions(array $comments, array $expected) { + $this->skipIfNotSupport4ByteUTF(); $manager = $this->getManager(); $buffer = []; @@ -1026,6 +1037,7 @@ class ManagerTest extends TestCase { * @dataProvider providerTestRetrieveAllReactionsWithSpecificReaction */ public function testRetrieveAllReactionsWithSpecificReaction(array $comments, string $reaction, array $expected) { + $this->skipIfNotSupport4ByteUTF(); $manager = $this->getManager(); $buffer = []; @@ -1090,6 +1102,7 @@ class ManagerTest extends TestCase { * @dataProvider providerTestGetReactionComment */ public function testGetReactionComment(array $comments, $expected) { + $this->skipIfNotSupport4ByteUTF(); $manager = $this->getManager(); $buffer = []; |