diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-11-16 20:57:41 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-16 21:10:11 +0100 |
commit | daa388ce8d8ea653d3cae2e016cabd266d19d674 (patch) | |
tree | a59d35736549945654460e7746f37db0aea185c5 /tests | |
parent | 5ec64c4fd7f087027ef945c4d694de1d90bbd814 (diff) | |
download | nextcloud-server-daa388ce8d8ea653d3cae2e016cabd266d19d674.tar.gz nextcloud-server-daa388ce8d8ea653d3cae2e016cabd266d19d674.zip |
Move index.php from files to AppFramework
1. Allows it to use the more secure CSP rules of the AppFramework.
2. Adds some unit tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/helper.php | 28 | ||||
-rw-r--r-- | tests/lib/urlgenerator.php | 10 |
2 files changed, 25 insertions, 13 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php index bd527de160d..ca3e0e46d82 100644 --- a/tests/lib/helper.php +++ b/tests/lib/helper.php @@ -353,18 +353,24 @@ class Test_Helper extends \Test\TestCase { $this->assertEquals($expectedResult, $result); } + /** + * @return array + */ public function provideDocRootAppUrlParts() { return array( - array('files', 'index.php', array(), '/index.php/apps/files'), - array('files', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files?trut=trat&dut=dat'), + array('files', 'ajax/list.php', array(), '/index.php/apps/files/ajax/list.php'), + array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php?trut=trat&dut=dat'), ); } + /** + * @return array + */ public function provideSubDirAppUrlParts() { return array( - array('files', 'index.php', array(), '/owncloud/index.php/apps/files'), - array('files', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files?trut=trat&dut=dat'), + array('files', 'ajax/list.php', array(), '/owncloud/index.php/apps/files/ajax/list.php'), + array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php?trut=trat&dut=dat'), ); } @@ -393,18 +399,24 @@ class Test_Helper extends \Test\TestCase { $this->assertEquals($expectedResult, $result); } + /** + * @return array + */ public function provideDocRootAppAbsoluteUrlParts() { return array( - array('files', 'index.php', array(), 'http://localhost/index.php/apps/files'), - array('files', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), 'http://localhost/index.php/apps/files?trut=trat&dut=dat'), + array('files', 'ajax/list.php', array(), 'http://localhost/index.php/apps/files/ajax/list.php'), + array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), 'http://localhost/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), 'http://localhost/index.php?trut=trat&dut=dat'), ); } + /** + * @return array + */ public function provideSubDirAppAbsoluteUrlParts() { return array( - array('files', 'index.php', array(), 'http://localhost/owncloud/index.php/apps/files'), - array('files', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), 'http://localhost/owncloud/index.php/apps/files?trut=trat&dut=dat'), + array('files', 'ajax/list.php', array(), 'http://localhost/owncloud/index.php/apps/files/ajax/list.php'), + array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), 'http://localhost/owncloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), 'http://localhost/owncloud/index.php?trut=trat&dut=dat'), ); } diff --git a/tests/lib/urlgenerator.php b/tests/lib/urlgenerator.php index 60e1a86f16a..a5ab483109f 100644 --- a/tests/lib/urlgenerator.php +++ b/tests/lib/urlgenerator.php @@ -53,23 +53,23 @@ class Test_Urlgenerator extends \Test\TestCase { public function provideRoutes() { return array( - array('files_index', 'http://localhost/owncloud/index.php/apps/files/'), + array('files_ajax_list', 'http://localhost/owncloud/index.php/apps/files/ajax/list.php'), array('core_ajax_preview', 'http://localhost/owncloud/index.php/core/preview.png'), ); } public function provideDocRootAppUrlParts() { return array( - array('files', 'index.php', array(), '/index.php/apps/files'), - array('files', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files?trut=trat&dut=dat'), + array('files', 'ajax/list.php', array(), '/index.php/apps/files/ajax/list.php'), + array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/index.php?trut=trat&dut=dat'), ); } public function provideSubDirAppUrlParts() { return array( - array('files', 'index.php', array(), '/owncloud/index.php/apps/files'), - array('files', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files?trut=trat&dut=dat'), + array('files', 'ajax/list.php', array(), '/owncloud/index.php/apps/files/ajax/list.php'), + array('files', 'ajax/list.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php/apps/files/ajax/list.php?trut=trat&dut=dat'), array('', 'index.php', array('trut' => 'trat', 'dut' => 'dat'), '/owncloud/index.php?trut=trat&dut=dat'), ); } |