method('getParsedBodyParam')->willReturnMap([['collation_connection', null, 'utf8mb4_general_ci']]); $response = self::createMock(ResponseRenderer::class); $response->expects(self::once())->method('redirect') ->with('index.php?route=/' . Url::getCommonRaw([], '&')); $response->expects(self::once())->method('response')->willReturn(ResponseFactory::create()->createResponse()); $userPreferencesHandler = self::createMock(UserPreferencesHandler::class); $userPreferencesHandler->expects(self::once())->method('setUserValue') ->with('DefaultConnectionCollation', 'utf8mb4_general_ci', 'utf8mb4_unicode_ci'); $userPreferencesHandler->expects(self::once())->method('updateConfigValue') ->with('DefaultConnectionCollation', 'utf8mb4_general_ci'); (new CollationConnectionController($response, $userPreferencesHandler))($request); } }