瀏覽代碼

Move Files app to PSR-4 (#24569)

* Move lib/ of Files app to PSR-4

* Move tests to PSR-4
tags/v9.1.0beta1
Joas Schilling 8 年之前
父節點
當前提交
b34bacd071

apps/files/lib/activity.php → apps/files/lib/Activity.php 查看文件


apps/files/lib/activityhelper.php → apps/files/lib/ActivityHelper.php 查看文件


apps/files/lib/app.php → apps/files/lib/App.php 查看文件


apps/files/appinfo/application.php → apps/files/lib/AppInfo/Application.php 查看文件


apps/files/lib/backgroundjob/cleanupfilelocks.php → apps/files/lib/BackgroundJob/CleanupFileLocks.php 查看文件


apps/files/lib/backgroundjob/deleteorphaneditems.php → apps/files/lib/BackgroundJob/DeleteOrphanedItems.php 查看文件


apps/files/lib/backgroundjob/scanfiles.php → apps/files/lib/BackgroundJob/ScanFiles.php 查看文件


apps/files/lib/capabilities.php → apps/files/lib/Capabilities.php 查看文件


apps/files/command/deleteorphanedfiles.php → apps/files/lib/Command/DeleteOrphanedFiles.php 查看文件


apps/files/command/scan.php → apps/files/lib/Command/Scan.php 查看文件


apps/files/command/transferownership.php → apps/files/lib/Command/TransferOwnership.php 查看文件


apps/files/controller/apicontroller.php → apps/files/lib/Controller/ApiController.php 查看文件


apps/files/controller/viewcontroller.php → apps/files/lib/Controller/ViewController.php 查看文件


apps/files/lib/helper.php → apps/files/lib/Helper.php 查看文件


apps/files/service/tagservice.php → apps/files/lib/Service/TagService.php 查看文件


apps/files/tests/activitytest.php → apps/files/tests/ActivityTest.php 查看文件


apps/files/tests/backgroundjob/DeleteOrphanedItemsJobTest.php → apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php 查看文件


apps/files/tests/backgroundjob/ScanFilesTest.php → apps/files/tests/BackgroundJob/ScanFilesTest.php 查看文件


apps/files/tests/command/deleteorphanedfilestest.php → apps/files/tests/Command/DeleteOrphanedFilesTest.php 查看文件


apps/files/tests/controller/apicontrollertest.php → apps/files/tests/Controller/ApiControllerTest.php 查看文件


apps/files/tests/controller/ViewControllerTest.php → apps/files/tests/Controller/ViewControllerTest.php 查看文件

@@ -26,6 +26,7 @@ namespace OCA\Files\Tests\Controller;

use OCA\Files\Controller\ViewController;
use OCP\AppFramework\Http;
use OCP\IUser;
use OCP\Template;
use Test\TestCase;
use OCP\IRequest;

apps/files/tests/helper.php → apps/files/tests/HelperTest.php 查看文件

@@ -23,12 +23,12 @@
*
*/

use OCA\Files;
use OCA\Files\Tests;

/**
* Class Test_Files_Helper
* Class Helper
*/
class Test_Files_Helper extends \Test\TestCase {
class HelperTest extends \Test\TestCase {

private function makeFileInfo($name, $size, $mtime, $isDir = false) {
return new \OC\Files\FileInfo(

apps/files/tests/service/tagservice.php → apps/files/tests/Service/TagServiceTest.php 查看文件

@@ -20,9 +20,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\Files;
namespace OCA\Files\Tests\Service;

use \OCA\Files\Service\TagService;
use OCA\Files\Service\TagService;

/**
* Class TagServiceTest
@@ -55,13 +55,11 @@ class TagServiceTest extends \Test\TestCase {

protected function setUp() {
parent::setUp();
$this->user = $this->getUniqueId('user');
$this->user = $this->getUniqueID('user');
\OC::$server->getUserManager()->createUser($this->user, 'test');
\OC_User::setUserId($this->user);
\OC_Util::setupFS($this->user);
/**
* @var \OCP\IUser
*/
/** @var \OCP\IUser */
$user = new \OC\User\User($this->user, null);
/**
* @var \OCP\IUserSession
@@ -105,12 +103,12 @@ class TagServiceTest extends \Test\TestCase {
$this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag2));

// remove tag
$result = $this->tagService->updateFileTags('subdir/test.txt', array($tag2));
$this->tagService->updateFileTags('subdir/test.txt', array($tag2));
$this->assertEquals(array(), $this->tagger->getIdsForTag($tag1));
$this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag2));

// clear tags
$result = $this->tagService->updateFileTags('subdir/test.txt', array());
$this->tagService->updateFileTags('subdir/test.txt', array());
$this->assertEquals(array(), $this->tagger->getIdsForTag($tag1));
$this->assertEquals(array(), $this->tagger->getIdsForTag($tag2));


Loading…
取消
儲存