aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AllConfigTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AllConfigTest.php')
-rw-r--r--tests/lib/AllConfigTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lib/AllConfigTest.php b/tests/lib/AllConfigTest.php
index ba48a078713..9d204754d96 100644
--- a/tests/lib/AllConfigTest.php
+++ b/tests/lib/AllConfigTest.php
@@ -93,6 +93,27 @@ class AllConfigTest extends \Test\TestCase {
$config->deleteUserValue('userSet', 'appSet', 'keySet');
}
+ /**
+ * This test needs to stay! Emails are expected to be lowercase due to performance reasons.
+ * This way we can skip the expensive casing change on the database.
+ */
+ public function testSetUserValueSettingsEmail(): void {
+ $selectAllSQL = 'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?';
+ $config = $this->getConfig();
+
+ $config->setUserValue('userSet', 'settings', 'email', 'mixed.CASE@domain.COM');
+
+ $result = $this->connection->executeQuery($selectAllSQL, ['userSet'])->fetchAll();
+
+ $this->assertEquals(1, count($result));
+ $this->assertEquals([
+ 'userid' => 'userSet',
+ 'appid' => 'settings',
+ 'configkey' => 'email',
+ 'configvalue' => 'mixed.case@domain.com'
+ ], $result[0]);
+ }
+
public function testSetUserValueWithPreCondition(): void {
$config = $this->getConfig();