summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-11-02 12:03:52 +0100
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-02 21:17:05 +0100
commitd235c4833f8fb8bb0b077276e2819cfbd2918313 (patch)
treec120bdc814fd95fd517f563c80c5594b09c994d0 /apps/files_sharing/tests
parentf556c58c22405945263bc6debfa6a424e2c601cb (diff)
downloadnextcloud-server-d235c4833f8fb8bb0b077276e2819cfbd2918313.tar.gz
nextcloud-server-d235c4833f8fb8bb0b077276e2819cfbd2918313.zip
remove the 'shareapi_allow_mail_notification' setting
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/MigrationTest.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/MigrationTest.php b/apps/files_sharing/tests/MigrationTest.php
index 7d6ca7840ed..572f64da743 100644
--- a/apps/files_sharing/tests/MigrationTest.php
+++ b/apps/files_sharing/tests/MigrationTest.php
@@ -39,6 +39,9 @@ class MigrationTest extends TestCase {
/** @var \OCP\IDBConnection */
private $connection;
+ /** @var \OCP\IConfig */
+ private $config;
+
/** @var Migration */
private $migration;
@@ -48,7 +51,8 @@ class MigrationTest extends TestCase {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
- $this->migration = new Migration($this->connection);
+ $this->config = \OC::$server->getConfig();
+ $this->migration = new Migration($this->connection, $this->config);
$this->cleanDB();
}
@@ -351,4 +355,26 @@ class MigrationTest extends TestCase {
$stmt->closeCursor();
$this->assertEquals(1001, $i);
}
+
+ /**
+ * test that we really remove the "shareapi_allow_mail_notification" setting only
+ */
+ public function testRemoveSendMailOption() {
+ $this->config->setAppValue('core', 'shareapi_setting1', 'dummy-value');
+ $this->config->setAppValue('core', 'shareapi_allow_mail_notification', 'no');
+ $this->config->setAppValue('core', 'shareapi_allow_public_notification', 'no');
+
+ $this->migration->removeSendMailOption();
+
+ $this->assertNull(
+ $this->config->getAppValue('core', 'shareapi_allow_mail_notification', null)
+ );
+ $this->assertNull(
+ $this->config->getAppValue('core', 'shareapi_allow_public_notification', null)
+ );
+
+ $this->assertSame('dummy-value',
+ $this->config->getAppValue('core', 'shareapi_setting1', null)
+ );
+ }
}