summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-05-19 10:43:49 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2016-05-19 11:18:25 +0200
commit392bc0c6b9967d3e33570ada51a391159d4d69aa (patch)
tree26bf91653e6aa726a12c0748d2b225ff31b77668
parent7ca5b35379144d868a36f10c237c78de56f4ed5a (diff)
downloadnextcloud-server-392bc0c6b9967d3e33570ada51a391159d4d69aa.tar.gz
nextcloud-server-392bc0c6b9967d3e33570ada51a391159d4d69aa.zip
Move tests/core/ to PSR-4
-rw-r--r--tests/Core/Command/Config/App/DeleteConfigTest.php (renamed from tests/core/command/config/app/deleteconfigtest.php)0
-rw-r--r--tests/Core/Command/Config/App/GetConfigTest.php (renamed from tests/core/command/config/app/getconfigtest.php)0
-rw-r--r--tests/Core/Command/Config/App/SetConfigTest.php (renamed from tests/core/command/config/app/setconfigtest.php)0
-rw-r--r--tests/Core/Command/Config/ImportTest.php (renamed from tests/core/command/config/importtest.php)0
-rw-r--r--tests/Core/Command/Config/ListConfigsTest.php (renamed from tests/core/command/config/listconfigstest.php)0
-rw-r--r--tests/Core/Command/Config/System/DeleteConfigTest.php (renamed from tests/core/command/config/system/deleteconfigtest.php)0
-rw-r--r--tests/Core/Command/Config/System/GetConfigTest.php (renamed from tests/core/command/config/system/getconfigtest.php)0
-rw-r--r--tests/Core/Command/Config/System/SetConfigTest.php (renamed from tests/core/command/config/system/setconfigtest.php)0
-rw-r--r--tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php (renamed from tests/core/command/encryption/changekeystorageroottest.php)0
-rw-r--r--tests/Core/Command/Encryption/DecryptAllTest.php (renamed from tests/core/command/encryption/decryptalltest.php)0
-rw-r--r--tests/Core/Command/Encryption/DisableTest.php (renamed from tests/core/command/encryption/disabletest.php)0
-rw-r--r--tests/Core/Command/Encryption/EnableTest.php (renamed from tests/core/command/encryption/enabletest.php)0
-rw-r--r--tests/Core/Command/Encryption/EncryptAllTest.php (renamed from tests/core/command/encryption/encryptalltest.php)0
-rw-r--r--tests/Core/Command/Encryption/SetDefaultModuleTest.php (renamed from tests/core/command/encryption/setdefaultmoduletest.php)0
-rw-r--r--tests/Core/Command/Log/ManageTest.php (renamed from tests/core/command/log/managetest.php)0
-rw-r--r--tests/Core/Command/Log/OwnCloudTest.php (renamed from tests/core/command/log/owncloudtest.php)0
-rw-r--r--tests/Core/Command/Maintenance/DataFingerprintTest.php (renamed from tests/core/command/maintenance/datafingerprinttest.php)0
-rw-r--r--tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php (renamed from tests/core/command/maintenance/mimetype/updatedbtest.php)0
-rw-r--r--tests/Core/Command/Maintenance/SingleUserTest.php (renamed from tests/core/command/maintenance/singleusertest.php)0
-rw-r--r--tests/Core/Command/User/DeleteTest.php (renamed from tests/core/command/user/deletetest.php)0
-rw-r--r--tests/Core/Command/User/LastSeenTest.php (renamed from tests/core/command/user/lastseentest.php)0
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php (renamed from tests/core/controller/avatarcontrollertest.php)33
-rw-r--r--tests/Core/Controller/LoginControllerTest.php (renamed from tests/core/controller/LoginControllerTest.php)3
-rw-r--r--tests/Core/Controller/LostControllerTest.php (renamed from tests/core/controller/lostcontrollertest.php)3
-rw-r--r--tests/Core/Controller/TokenControllerTest.php (renamed from tests/core/controller/TokenControllerTest.php)3
-rw-r--r--tests/Core/Templates/TemplatesTest.php (renamed from tests/core/templates/templates.php)2
26 files changed, 23 insertions, 21 deletions
diff --git a/tests/core/command/config/app/deleteconfigtest.php b/tests/Core/Command/Config/App/DeleteConfigTest.php
index 7056e1b1ff9..7056e1b1ff9 100644
--- a/tests/core/command/config/app/deleteconfigtest.php
+++ b/tests/Core/Command/Config/App/DeleteConfigTest.php
diff --git a/tests/core/command/config/app/getconfigtest.php b/tests/Core/Command/Config/App/GetConfigTest.php
index 1ceeb16ccf4..1ceeb16ccf4 100644
--- a/tests/core/command/config/app/getconfigtest.php
+++ b/tests/Core/Command/Config/App/GetConfigTest.php
diff --git a/tests/core/command/config/app/setconfigtest.php b/tests/Core/Command/Config/App/SetConfigTest.php
index 14d7b0cb7b5..14d7b0cb7b5 100644
--- a/tests/core/command/config/app/setconfigtest.php
+++ b/tests/Core/Command/Config/App/SetConfigTest.php
diff --git a/tests/core/command/config/importtest.php b/tests/Core/Command/Config/ImportTest.php
index f14880f8bf4..f14880f8bf4 100644
--- a/tests/core/command/config/importtest.php
+++ b/tests/Core/Command/Config/ImportTest.php
diff --git a/tests/core/command/config/listconfigstest.php b/tests/Core/Command/Config/ListConfigsTest.php
index bde6a1b0db3..bde6a1b0db3 100644
--- a/tests/core/command/config/listconfigstest.php
+++ b/tests/Core/Command/Config/ListConfigsTest.php
diff --git a/tests/core/command/config/system/deleteconfigtest.php b/tests/Core/Command/Config/System/DeleteConfigTest.php
index 11bfb6ae7ad..11bfb6ae7ad 100644
--- a/tests/core/command/config/system/deleteconfigtest.php
+++ b/tests/Core/Command/Config/System/DeleteConfigTest.php
diff --git a/tests/core/command/config/system/getconfigtest.php b/tests/Core/Command/Config/System/GetConfigTest.php
index ebbea634cde..ebbea634cde 100644
--- a/tests/core/command/config/system/getconfigtest.php
+++ b/tests/Core/Command/Config/System/GetConfigTest.php
diff --git a/tests/core/command/config/system/setconfigtest.php b/tests/Core/Command/Config/System/SetConfigTest.php
index c0b664d7522..c0b664d7522 100644
--- a/tests/core/command/config/system/setconfigtest.php
+++ b/tests/Core/Command/Config/System/SetConfigTest.php
diff --git a/tests/core/command/encryption/changekeystorageroottest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
index 2a1f48983f1..2a1f48983f1 100644
--- a/tests/core/command/encryption/changekeystorageroottest.php
+++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
diff --git a/tests/core/command/encryption/decryptalltest.php b/tests/Core/Command/Encryption/DecryptAllTest.php
index 972ea03150c..972ea03150c 100644
--- a/tests/core/command/encryption/decryptalltest.php
+++ b/tests/Core/Command/Encryption/DecryptAllTest.php
diff --git a/tests/core/command/encryption/disabletest.php b/tests/Core/Command/Encryption/DisableTest.php
index dfd06e2e26e..dfd06e2e26e 100644
--- a/tests/core/command/encryption/disabletest.php
+++ b/tests/Core/Command/Encryption/DisableTest.php
diff --git a/tests/core/command/encryption/enabletest.php b/tests/Core/Command/Encryption/EnableTest.php
index e2357464aa1..e2357464aa1 100644
--- a/tests/core/command/encryption/enabletest.php
+++ b/tests/Core/Command/Encryption/EnableTest.php
diff --git a/tests/core/command/encryption/encryptalltest.php b/tests/Core/Command/Encryption/EncryptAllTest.php
index 128b4caa148..128b4caa148 100644
--- a/tests/core/command/encryption/encryptalltest.php
+++ b/tests/Core/Command/Encryption/EncryptAllTest.php
diff --git a/tests/core/command/encryption/setdefaultmoduletest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
index 3230a57db07..3230a57db07 100644
--- a/tests/core/command/encryption/setdefaultmoduletest.php
+++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
diff --git a/tests/core/command/log/managetest.php b/tests/Core/Command/Log/ManageTest.php
index 6fb83347f23..6fb83347f23 100644
--- a/tests/core/command/log/managetest.php
+++ b/tests/Core/Command/Log/ManageTest.php
diff --git a/tests/core/command/log/owncloudtest.php b/tests/Core/Command/Log/OwnCloudTest.php
index 3cb05221c37..3cb05221c37 100644
--- a/tests/core/command/log/owncloudtest.php
+++ b/tests/Core/Command/Log/OwnCloudTest.php
diff --git a/tests/core/command/maintenance/datafingerprinttest.php b/tests/Core/Command/Maintenance/DataFingerprintTest.php
index 4d661b5c027..4d661b5c027 100644
--- a/tests/core/command/maintenance/datafingerprinttest.php
+++ b/tests/Core/Command/Maintenance/DataFingerprintTest.php
diff --git a/tests/core/command/maintenance/mimetype/updatedbtest.php b/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php
index 217301102c5..217301102c5 100644
--- a/tests/core/command/maintenance/mimetype/updatedbtest.php
+++ b/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php
diff --git a/tests/core/command/maintenance/singleusertest.php b/tests/Core/Command/Maintenance/SingleUserTest.php
index 6629f39564f..6629f39564f 100644
--- a/tests/core/command/maintenance/singleusertest.php
+++ b/tests/Core/Command/Maintenance/SingleUserTest.php
diff --git a/tests/core/command/user/deletetest.php b/tests/Core/Command/User/DeleteTest.php
index bb813626d7a..bb813626d7a 100644
--- a/tests/core/command/user/deletetest.php
+++ b/tests/Core/Command/User/DeleteTest.php
diff --git a/tests/core/command/user/lastseentest.php b/tests/Core/Command/User/LastSeenTest.php
index 84805f5c072..84805f5c072 100644
--- a/tests/core/command/user/lastseentest.php
+++ b/tests/Core/Command/User/LastSeenTest.php
diff --git a/tests/core/controller/avatarcontrollertest.php b/tests/Core/Controller/AvatarControllerTest.php
index c99b69228b1..937d8aaf17b 100644
--- a/tests/core/controller/avatarcontrollertest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -18,13 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-namespace OC\Core\Controller;
-use OC;
+namespace Tests\Core\Controller;
+
use OC\Core\Application;
use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\Http;
-use OCP\Files\Folder;
use OCP\Files\File;
use OCP\Files\NotFoundException;
use OCP\IUser;
@@ -52,7 +51,7 @@ class AvatarControllerTest extends \Test\TestCase {
/** @var IAppContainer */
private $container;
- /** @var AvatarController */
+ /** @var \OC\Core\Controller\AvatarController */
private $avatarController;
/** @var IAvatar */
private $avatarMock;
@@ -228,7 +227,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Fetch tmp avatar
*/
public function testTmpAvatarValid() {
- $this->container['Cache']->method('get')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->container['Cache']->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$response = $this->avatarController->getTmpAvatar();
$this->assertEquals(Http::STATUS_OK, $response->getStatus());
@@ -250,14 +249,14 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostAvatarFile() {
//Create temp file
$fileName = tempnam(null, "avatarTest");
- $copyRes = copy(OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName);
+ $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName);
$this->assertTrue($copyRes);
//Create file in cache
- $this->container['Cache']->method('get')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->container['Cache']->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
//Create request return
- $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(OC::$SERVERROOT.'/tests/data/testimage.jpg')]];
+ $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [filesize(\OC::$SERVERROOT.'/tests/data/testimage.jpg')]];
$this->container['Request']->method('getUploadedFile')->willReturn($reqRet);
$response = $this->avatarController->postAvatar(null);
@@ -288,14 +287,14 @@ class AvatarControllerTest extends \Test\TestCase {
public function testPostAvatarFileGif() {
//Create temp file
$fileName = tempnam(null, "avatarTest");
- $copyRes = copy(OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName);
+ $copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName);
$this->assertTrue($copyRes);
//Create file in cache
- $this->container['Cache']->method('get')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif'));
+ $this->container['Cache']->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.gif'));
//Create request return
- $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => filesize(OC::$SERVERROOT.'/tests/data/testimage.gif')];
+ $reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => filesize(\OC::$SERVERROOT.'/tests/data/testimage.gif')];
$this->container['Request']->method('getUploadedFile')->willReturn($reqRet);
$response = $this->avatarController->postAvatar(null);
@@ -313,7 +312,7 @@ class AvatarControllerTest extends \Test\TestCase {
//Mock node API call
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
- $file->method('getContent')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $file->method('getContent')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->container['UserFolder']->method('get')->willReturn($file);
//Create request return
@@ -349,7 +348,7 @@ class AvatarControllerTest extends \Test\TestCase {
->will($this->throwException(new \Exception("foo")));
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
- $file->method('getContent')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $file->method('getContent')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->container['UserFolder']->method('get')->willReturn($file);
$this->container['Logger']->expects($this->once())
@@ -382,7 +381,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Test with non square crop
*/
public function testPostCroppedAvatarNoSquareCrop() {
- $this->container['Cache']->method('get')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->container['Cache']->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarMock->method('set')->will($this->throwException(new \OC\NotSquareException));
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
@@ -395,7 +394,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Check for proper reply on proper crop argument
*/
public function testPostCroppedAvatarValidCrop() {
- $this->container['Cache']->method('get')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->container['Cache']->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]);
@@ -407,7 +406,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Test what happens if the cropping of the avatar fails
*/
public function testPostCroppedAvatarException() {
- $this->container['Cache']->method('get')->willReturn(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg'));
+ $this->container['Cache']->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarMock->method('set')->will($this->throwException(new \Exception('foo')));
$this->container['AvatarManager']->method('getAvatar')->willReturn($this->avatarMock);
@@ -424,7 +423,7 @@ class AvatarControllerTest extends \Test\TestCase {
* Check for proper reply on proper crop argument
*/
public function testFileTooBig() {
- $fileName = OC::$SERVERROOT.'/tests/data/testimage.jpg';
+ $fileName = \OC::$SERVERROOT.'/tests/data/testimage.jpg';
//Create request return
$reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [21*1024*1024]];
$this->container['Request']->method('getUploadedFile')->willReturn($reqRet);
diff --git a/tests/core/controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index 139d48ad7da..32902a01530 100644
--- a/tests/core/controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -19,8 +19,9 @@
*
*/
-namespace OC\Core\Controller;
+namespace Tests\Core\Controller;
+use OC\Core\Controller\LoginController;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
diff --git a/tests/core/controller/lostcontrollertest.php b/tests/Core/Controller/LostControllerTest.php
index 44bc539247f..ca63c3404eb 100644
--- a/tests/core/controller/lostcontrollertest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -19,8 +19,9 @@
*
*/
-namespace OC\Core\Controller;
+namespace Tests\Core\Controller;
+use OC\Core\Controller\LostController;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IConfig;
diff --git a/tests/core/controller/TokenControllerTest.php b/tests/Core/Controller/TokenControllerTest.php
index 4635f96f48f..b600bfa5451 100644
--- a/tests/core/controller/TokenControllerTest.php
+++ b/tests/Core/Controller/TokenControllerTest.php
@@ -20,9 +20,10 @@
*
*/
-namespace OC\Core\Controller;
+namespace Tests\Core\Controller;
use OC\AppFramework\Http;
+use OC\Core\Controller\TokenController;
use OCP\AppFramework\Http\Response;
use Test\TestCase;
diff --git a/tests/core/templates/templates.php b/tests/Core/Templates/TemplatesTest.php
index 338d80b276c..03565411a13 100644
--- a/tests/core/templates/templates.php
+++ b/tests/Core/Templates/TemplatesTest.php
@@ -2,7 +2,7 @@
namespace Tests\Core\Templates;
-class Templates extends \Test\TestCase {
+class TemplatesTest extends \Test\TestCase {
public function test403() {
$template = \OC::$SERVERROOT . '/core/templates/403.php';