aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIndividual IT Services <info@individual-it.net>2015-09-10 10:05:07 +0545
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-29 15:34:42 +0200
commitfbe43e6a267389aebacd08b0d3965ee29f7b0c4c (patch)
tree06a4ba555f1b10aabe70a8d76b24a7936c43229f /tests
parent1abd4f52bb5a2300a279d8b9eb0d15d22721b575 (diff)
downloadnextcloud-server-fbe43e6a267389aebacd08b0d3965ee29f7b0c4c.tar.gz
nextcloud-server-fbe43e6a267389aebacd08b0d3965ee29f7b0c4c.zip
cache result of \OCP\Util::needUpgrade()
reduce calls of \OCP\Util::needUpgrade() where \OCP\Util::needUpgrade() is called we can call as well self::checkUpgrade and use the cached result In line 877 the call way unnecessary anyway because of the first part of the if statement move caching to \OCP\Util::needUpgrade renaming variable fixing testNeedUpgradeCore() cache result of checkUpgrade() in self::$needUpgrade reduce calls of \OCP\Util::needUpgrade() where \OCP\Util::needUpgrade() is called we can call as well self::checkUpgrade and use the cached result In line 877 the call way unnecessary anyway because of the first part of the if statement move caching to \OCP\Util::needUpgrade renaming variable fixing testNeedUpgradeCore() fix typo in variable name deleting tabs
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/util.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/lib/util.php b/tests/lib/util.php
index b9b8062653e..49579b3b6bd 100644
--- a/tests/lib/util.php
+++ b/tests/lib/util.php
@@ -406,11 +406,13 @@ class Test_Util extends \Test\TestCase {
OC_Config::setValue('version', '7.0.0.0');
\OC::$server->getSession()->set('OC_Version', array(7, 0, 0, 1));
+ self::invokePrivate(new \OCP\Util, 'needUpgradeCache', array(null));
$this->assertTrue(\OCP\Util::needUpgrade());
OC_Config::setValue('version', $oldConfigVersion);
$oldSessionVersion = \OC::$server->getSession()->set('OC_Version', $oldSessionVersion);
+ self::invokePrivate(new \OCP\Util, 'needUpgradeCache', array(null));
$this->assertFalse(\OCP\Util::needUpgrade());
}