diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-01-16 11:30:08 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-01-23 17:34:04 +0100 |
commit | 10664e952917094f7af15900421f0c0d50b860b8 (patch) | |
tree | 2027c146cf1f0998b1b740760ec517a28810c93d /apps/settings/tests | |
parent | a09107af7a8a62862ec1e76cf8d518efc18f0d34 (diff) | |
download | nextcloud-server-10664e952917094f7af15900421f0c0d50b860b8.tar.gz nextcloud-server-10664e952917094f7af15900421f0c0d50b860b8.zip |
Migrate MySQL utf8mb4 check to new SetupCheck API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings/tests')
-rw-r--r-- | apps/settings/tests/Controller/CheckSetupControllerTest.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index bad15a72191..b888e0ce7c8 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -118,7 +118,6 @@ class CheckSetupControllerTest extends TestCase { 'getCurlVersion', 'isPhpOutdated', 'isPHPMailerUsed', - 'isMysqlUsedWithoutUTF8MB4', 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed', ])->getMock(); } @@ -144,11 +143,6 @@ class CheckSetupControllerTest extends TestCase { $this->checkSetupController ->expects($this->once()) - ->method('isMysqlUsedWithoutUTF8MB4') - ->willReturn(false); - - $this->checkSetupController - ->expects($this->once()) ->method('isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed') ->willReturn(true); @@ -186,7 +180,6 @@ class CheckSetupControllerTest extends TestCase { $expected = new DataResponse( [ 'reverseProxyDocs' => 'reverse-proxy-doc-link', - 'isMysqlUsedWithoutUTF8MB4' => false, 'isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed' => true, 'reverseProxyGeneratedURL' => 'https://server/index.php', 'isFairUseOfFreePushService' => false, @@ -653,50 +646,6 @@ Array $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles()); } - public function dataForIsMysqlUsedWithoutUTF8MB4() { - return [ - ['sqlite', false, false], - ['sqlite', true, false], - ['postgres', false, false], - ['postgres', true, false], - ['oci', false, false], - ['oci', true, false], - ['mysql', false, true], - ['mysql', true, false], - ]; - } - - /** - * @dataProvider dataForIsMysqlUsedWithoutUTF8MB4 - */ - public function testIsMysqlUsedWithoutUTF8MB4(string $db, bool $useUTF8MB4, bool $expected) { - $this->config->method('getSystemValue') - ->willReturnCallback(function ($key, $default) use ($db, $useUTF8MB4) { - if ($key === 'dbtype') { - return $db; - } - if ($key === 'mysql.utf8mb4') { - return $useUTF8MB4; - } - return $default; - }); - - $checkSetupController = new CheckSetupController( - 'settings', - $this->request, - $this->config, - $this->urlGenerator, - $this->l10n, - $this->checker, - $this->logger, - $this->tempManager, - $this->notificationManager, - $this->setupCheckManager, - ); - - $this->assertSame($expected, $this->invokePrivate($checkSetupController, 'isMysqlUsedWithoutUTF8MB4')); - } - public function dataForIsEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed() { return [ ['singlebucket', 'OC\\Files\\ObjectStore\\Swift', true], |