From 7fbb7f4dc4cd1918a5b3dfaa4c8dfb6a7e11d0c3 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 8 Jan 2015 12:05:54 +0100 Subject: Add version to .htaccess Currently if a user does not replace the .htaccess file with the new update this can lead to serious problems in case Apache is used as webserver. This commit adds the version to the .htaccess file and the update routine fails in case not the newest version is specified in there. This obviously means that every release has to update the version specified in .htaccess as well. But I see no better solution for it. Conflicts: lib/private/updater.php --- tests/lib/setup.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/lib/setup.php b/tests/lib/setup.php index 8373ba316d6..a221943c016 100644 --- a/tests/lib/setup.php +++ b/tests/lib/setup.php @@ -19,7 +19,7 @@ class Test_OC_Setup extends \Test\TestCase { parent::setUp(); $this->config = $this->getMock('\OCP\IConfig'); - $this->setupClass = $this->getMock('\OC_Setup', array('class_exists', 'is_callable'), array($this->config)); + $this->setupClass = $this->getMock('\OC_Setup', ['class_exists', 'is_callable'], [$this->config]); } public function testGetSupportedDatabasesWithOneWorking() { @@ -102,4 +102,17 @@ class Test_OC_Setup extends \Test\TestCase { ->will($this->returnValue('NotAnArray')); $this->setupClass->getSupportedDatabases(); } + + /** + * This is actual more an integration test whether the version parameter in the .htaccess + * was updated as well when the version has been incremented. + * If it hasn't this test will fail. + */ + public function testHtaccessIsCurrent() { + $result = Test_Helper::invokePrivate( + $this->setupClass, + 'isCurrentHtaccess' + ); + $this->assertTrue($result); + } } \ No newline at end of file -- cgit v1.2.3