[Pkg-owncloud-commits] [owncloud] 26/258: Added test for needUpgrade for core

David Prévot taffit at moszumanska.debian.org
Sat Oct 11 17:22:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 28e1480d1c8d9a167c24fbe4a4e7cab124ab8e28
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Tue Sep 2 17:28:05 2014 +0200

    Added test for needUpgrade for core
---
 tests/lib/util.php | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/lib/util.php b/tests/lib/util.php
index 98257e4..a2efcca 100644
--- a/tests/lib/util.php
+++ b/tests/lib/util.php
@@ -344,6 +344,25 @@ class Test_Util extends PHPUnit_Framework_TestCase {
 		);
 	}
 
+	/**
+	 * Test needUpgrade() when the core version is increased
+	 */
+	public function testNeedUpgradeCore() {
+		$oldConfigVersion = OC_Config::getValue('version', '0.0.0');
+		$oldSessionVersion = \OC::$server->getSession()->get('OC_Version');
+
+		$this->assertFalse(\OCP\Util::needUpgrade());
+
+		OC_Config::setValue('version', '7.0.0.0');
+		\OC::$server->getSession()->set('OC_Version', array(7, 0, 0, 1));
+
+		$this->assertTrue(\OCP\Util::needUpgrade());
+
+		OC_Config::setValue('version', $oldConfigVersion);
+		$oldSessionVersion = \OC::$server->getSession()->set('OC_Version', $oldSessionVersion);
+
+		$this->assertFalse(\OCP\Util::needUpgrade());
+	}
 }
 
 /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list