Move Files app to PSR-4 (#24569)
* Move lib/ of Files app to PSR-4 * Move tests to PSR-4
This commit is contained in:
parent
eea98f1d74
commit
b34bacd071
23 changed files with 10 additions and 11 deletions
|
@ -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;
|
|
@ -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(
|
|
@ -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…
Reference in a new issue