summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-03 20:45:02 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-03 20:45:02 +0200
commit7959605e4e389ee26705094656f636f23b9cfb8d (patch)
treef16ec80ebaf382629cdadef773c1dcb8d8e6d9e2 /tests
parent3df27a01bea923237cfa9db0c2238e0fb022c06b (diff)
parent43ebf0d1272de80007d016aacd8dcdefc318b78d (diff)
downloadnextcloud-server-7959605e4e389ee26705094656f636f23b9cfb8d.tar.gz
nextcloud-server-7959605e4e389ee26705094656f636f23b9cfb8d.zip
Merge pull request #17378 from owncloud/kill-more-legacy-classes
Kill more legacy classes
Diffstat (limited to 'tests')
-rw-r--r--tests/bootstrap.php1
-rw-r--r--tests/lib/appconfig.php1
-rw-r--r--tests/lib/logger.php2
-rw-r--r--tests/lib/share/share.php32
4 files changed, 17 insertions, 19 deletions
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 085eb2069c4..bd94ca67754 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -17,4 +17,3 @@ if (!class_exists('PHPUnit_Framework_TestCase')) {
}
OC_Hook::clear();
-OC_Log::$enabled = false;
diff --git a/tests/lib/appconfig.php b/tests/lib/appconfig.php
index adff45706cc..5a2cb3f88fc 100644
--- a/tests/lib/appconfig.php
+++ b/tests/lib/appconfig.php
@@ -68,7 +68,6 @@ class Test_Appconfig extends \Test\TestCase {
public function getAppConfigs() {
return [
- ['\OC_Appconfig'],
[new \OC\AppConfig(\OC::$server->getDatabaseConnection())],
];
}
diff --git a/tests/lib/logger.php b/tests/lib/logger.php
index 9a9f5be12fc..c8566988cf4 100644
--- a/tests/lib/logger.php
+++ b/tests/lib/logger.php
@@ -40,7 +40,7 @@ class Logger extends TestCase {
$this->config->expects($this->any())
->method('getValue')
->will(($this->returnValueMap([
- ['loglevel', \OC_Log::WARN, \OC_Log::WARN],
+ ['loglevel', \OCP\Util::WARN, \OCP\Util::WARN],
['log.condition', [], ['apps' => ['files']]]
])));
$logger = $this->logger;
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index 92f6b612688..e225f2a4002 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -74,8 +74,8 @@ class Test_Share extends \Test\TestCase {
OCP\Share::registerBackend('test', 'Test_Share_Backend');
OC_Hook::clear('OCP\\Share');
OC::registerShareHooks();
- $this->resharing = OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes');
- OC_Appconfig::setValue('core', 'shareapi_allow_resharing', 'yes');
+ $this->resharing = \OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_resharing', 'yes');
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes');
// 20 Minutes in the past, 20 minutes in the future.
$now = time();
@@ -87,7 +87,7 @@ class Test_Share extends \Test\TestCase {
protected function tearDown() {
$query = OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `item_type` = ?');
$query->execute(array('test'));
- OC_Appconfig::setValue('core', 'shareapi_allow_resharing', $this->resharing);
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', $this->resharing);
OC_User::deleteUser($this->user1);
OC_User::deleteUser($this->user2);
@@ -486,8 +486,8 @@ class Test_Share extends \Test\TestCase {
);
// exclude group2 from sharing
- \OC_Appconfig::setValue('core', 'shareapi_exclude_groups_list', $this->group2);
- \OC_Appconfig::setValue('core', 'shareapi_exclude_groups', "yes");
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups_list', $this->group2);
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', "yes");
OC_User::setUserId($this->user4);
@@ -496,8 +496,8 @@ class Test_Share extends \Test\TestCase {
$this->assertSame(\OCP\Constants::PERMISSION_ALL & ~\OCP\Constants::PERMISSION_SHARE, $share['permissions'],
'Failed asserting that user 4 is excluded from re-sharing');
- \OC_Appconfig::deleteKey('core', 'shareapi_exclude_groups_list');
- \OC_Appconfig::deleteKey('core', 'shareapi_exclude_groups');
+ \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_exclude_groups_list');
+ \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_exclude_groups');
}
@@ -569,8 +569,8 @@ class Test_Share extends \Test\TestCase {
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
}
- $policy = OC_Appconfig::getValue('core', 'shareapi_only_share_with_group_members', 'no');
- OC_Appconfig::setValue('core', 'shareapi_only_share_with_group_members', 'yes');
+ $policy = \OC::$server->getAppConfig()->getValue('core', 'shareapi_only_share_with_group_members', 'no');
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_only_share_with_group_members', 'yes');
$message = 'Sharing test.txt failed, because '.$this->user1.' is not a member of the group '.$this->group2;
try {
OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group2, \OCP\Constants::PERMISSION_READ);
@@ -578,7 +578,7 @@ class Test_Share extends \Test\TestCase {
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
}
- OC_Appconfig::setValue('core', 'shareapi_only_share_with_group_members', $policy);
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_only_share_with_group_members', $policy);
// Valid share
$this->shareUserOneTestFileWithGroupOne();
@@ -1224,9 +1224,9 @@ class Test_Share extends \Test\TestCase {
public function testClearExpireDateWhileEnforced() {
OC_User::setUserId($this->user1);
- \OC_Appconfig::setValue('core', 'shareapi_default_expire_date', 'yes');
- \OC_Appconfig::setValue('core', 'shareapi_expire_after_n_days', '2');
- \OC_Appconfig::setValue('core', 'shareapi_enforce_expire_date', 'yes');
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_default_expire_date', 'yes');
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_expire_after_n_days', '2');
+ \OC::$server->getAppConfig()->setValue('core', 'shareapi_enforce_expire_date', 'yes');
$token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ);
$this->assertInternalType(
@@ -1247,9 +1247,9 @@ class Test_Share extends \Test\TestCase {
$this->assertTrue($setExpireDateFailed);
- \OC_Appconfig::deleteKey('core', 'shareapi_default_expire_date');
- \OC_Appconfig::deleteKey('core', 'shareapi_expire_after_n_days');
- \OC_Appconfig::deleteKey('core', 'shareapi_enforce_expire_date');
+ \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_default_expire_date');
+ \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_expire_after_n_days');
+ \OC::$server->getAppConfig()->deleteKey('core', 'shareapi_enforce_expire_date');
}
/**