use OCP\ILogger;
use OCP\IURLGenerator;
+/**
+ * Class GetSharedSecretTest
+ *
+ * @group DB
+ *
+ * @package OCA\Federation\Tests\BackgroundJob
+ */
class GetSharedSecretTest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject | IClient */
namespace Test\Files\Storage;
+/**
+ * Class AmazonS3Migration
+ *
+ * @group DB
+ *
+ * @package Test\Files\Storage
+ */
class AmazonS3Migration extends \Test\TestCase {
/**
use OC\Files\Filesystem;
use OC\User\User;
+/**
+ * Class EtagPropagator
+ *
+ * @group DB
+ *
+ * @package Tests\Files_External
+ */
class EtagPropagator extends \Test\TestCase {
protected function getUser() {
return new User($this->getUniqueID(), null);
namespace Test\Files\Storage;
+/**
+ * Class OwnCloudFunctions
+ *
+ * @group DB
+ *
+ * @package Test\Files\Storage
+ */
class OwnCloudFunctions extends \Test\TestCase {
function configUrlProvider() {
use OCA\Files_Trashbin\Command\Expire;
use Test\TestCase;
+/**
+ * Class ExpireTest
+ *
+ * @group DB
+ *
+ * @package OCA\Files_Trashbin\Tests\Command
+ */
class ExpireTest extends TestCase {
public function testExpireNonExistingUser() {
$command = new Expire('test');
use OC\User\Manager;
use OCP\Files\IRootFolder;
+/**
+ * Class CleanupTest
+ *
+ * @group DB
+ *
+ * @package OCA\Files_Versions\Tests\Command
+ */
class CleanupTest extends TestCase {
/** @var CleanUp */
use OCA\Files_Versions\Command\Expire;
use Test\TestCase;
+/**
+ * Class ExpireTest
+ *
+ * @group DB
+ *
+ * @package OCA\Files_Versions\Tests\Command
+ */
class ExpireTest extends TestCase {
public function testExpireNonExistingUser() {
$command = new Expire($this->getUniqueID('test'), '');
use \OCA\user_ldap\lib\Connection;
use \OCA\user_ldap\lib\ILDAPWrapper;
+/**
+ * Class Test_Access
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_Access extends \Test\TestCase {
private function getConnectorAndLdapMock() {
static $conMethods;
namespace OCA\user_ldap\tests;
+/**
+ * Class Test_Connection
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_Connection extends \Test\TestCase {
public function testOriginalAgentUnchangedOnClone() {
$this->assertSame($agentPawd, $agent['ldapAgentPassword']);
}
-}
\ No newline at end of file
+}
use \OCA\user_ldap\lib\Connection;
use \OCA\user_ldap\lib\ILDAPWrapper;
+/**
+ * Class Test_Group_Ldap
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_Group_Ldap extends \Test\TestCase {
private function getAccessMock() {
static $conMethods;
use OCA\User_LDAP\Mapping\GroupMapping;
+/**
+ * Class Test_GroupMapping
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests\mapping
+ */
class Test_GroupMapping extends AbstractMappingTest {
public function getMapper(\OCP\IDBConnection $dbMock) {
return new GroupMapping($dbMock);
use OCA\User_LDAP\Mapping\UserMapping;
+/**
+ * Class Test_UserMapping
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests\mapping
+ */
class Test_UserMapping extends AbstractMappingTest {
public function getMapper(\OCP\IDBConnection $dbMock) {
return new UserMapping($dbMock);
use OCA\user_ldap\lib\user\Manager;
+/**
+ * Class Test_User_Manager
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_User_Manager extends \Test\TestCase {
private function getTestInstances() {
use OCA\user_ldap\lib\user\User;
+/**
+ * Class Test_User_User
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_User_User extends \Test\TestCase {
private function getTestInstances() {
use \OCA\user_ldap\lib\Connection;
use \OCA\user_ldap\lib\ILDAPWrapper;
+/**
+ * Class Test_User_Ldap_Direct
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_User_Ldap_Direct extends \Test\TestCase {
protected $backend;
protected $access;
// use \OCA\user_ldap\lib\Configuration;
// use \OCA\user_ldap\lib\ILDAPWrapper;
+/**
+ * Class Test_Wizard
+ *
+ * @group DB
+ *
+ * @package OCA\user_ldap\tests
+ */
class Test_Wizard extends \Test\TestCase {
protected function setUp() {
parent::setUp();
$this->secure = false;
}
if ($this->secure === true) {
+ // inject mock for testing
$certPath = \OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt';
if (file_exists($certPath)) {
$this->certPath = $certPath;
* Returns a url to the given route.
*/
public function linkToRoute($route, $parameters = array()) {
+ // TODO: mock router
$urlLinkTo = \OC::$server->getRouter()->generate($route, $parameters);
return $urlLinkTo;
}
--- /dev/null
+<?php
+/**
+ * Copyright (c) 2014 Bjoern Schiessle <schiessle@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+/**
+ * Class Test_UrlGenerator
+ *
+ * @group DB
+ */
+class Test_UrlGenerator extends \Test\TestCase {
+
+ /**
+ * @small
+ * test linkTo URL construction
+ * @dataProvider provideDocRootAppUrlParts
+ */
+ public function testLinkToDocRoot($app, $file, $args, $expectedResult) {
+ \OC::$WEBROOT = '';
+ $config = $this->getMock('\OCP\IConfig');
+ $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
+ $result = $urlGenerator->linkTo($app, $file, $args);
+
+ $this->assertEquals($expectedResult, $result);
+ }
+
+ /**
+ * @small
+ * test linkTo URL construction in sub directory
+ * @dataProvider provideSubDirAppUrlParts
+ */
+ public function testLinkToSubDir($app, $file, $args, $expectedResult) {
+ \OC::$WEBROOT = '/owncloud';
+ $config = $this->getMock('\OCP\IConfig');
+ $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
+ $result = $urlGenerator->linkTo($app, $file, $args);
+
+ $this->assertEquals($expectedResult, $result);
+ }
+
+ /**
+ * @dataProvider provideRoutes
+ */
+ public function testLinkToRouteAbsolute($route, $expected) {
+ \OC::$WEBROOT = '/owncloud';
+ $config = $this->getMock('\OCP\IConfig');
+ $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
+ $result = $urlGenerator->linkToRouteAbsolute($route);
+ $this->assertEquals($expected, $result);
+
+ }
+
+ public function provideRoutes() {
+ return array(
+ 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', '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', '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'),
+ );
+ }
+
+ /**
+ * @small
+ * test absolute URL construction
+ * @dataProvider provideDocRootURLs
+ */
+ function testGetAbsoluteURLDocRoot($url, $expectedResult) {
+
+ \OC::$WEBROOT = '';
+ $config = $this->getMock('\OCP\IConfig');
+ $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
+ $result = $urlGenerator->getAbsoluteURL($url);
+
+ $this->assertEquals($expectedResult, $result);
+ }
+
+ /**
+ * @small
+ * test absolute URL construction
+ * @dataProvider provideSubDirURLs
+ */
+ function testGetAbsoluteURLSubDir($url, $expectedResult) {
+
+ \OC::$WEBROOT = '/owncloud';
+ $config = $this->getMock('\OCP\IConfig');
+ $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
+ $result = $urlGenerator->getAbsoluteURL($url);
+
+ $this->assertEquals($expectedResult, $result);
+ }
+
+ public function provideDocRootURLs() {
+ return array(
+ array("index.php", "http://localhost/index.php"),
+ array("/index.php", "http://localhost/index.php"),
+ array("/apps/index.php", "http://localhost/apps/index.php"),
+ array("apps/index.php", "http://localhost/apps/index.php"),
+ );
+ }
+
+ public function provideSubDirURLs() {
+ return array(
+ array("index.php", "http://localhost/owncloud/index.php"),
+ array("/index.php", "http://localhost/owncloud/index.php"),
+ array("/apps/index.php", "http://localhost/owncloud/apps/index.php"),
+ array("apps/index.php", "http://localhost/owncloud/apps/index.php"),
+ );
+ }
+}
+
+++ /dev/null
-<?php
-/**
- * Copyright (c) 2014 Bjoern Schiessle <schiessle@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-class Test_Urlgenerator extends \Test\TestCase {
-
- /**
- * @small
- * test linkTo URL construction
- * @dataProvider provideDocRootAppUrlParts
- */
- public function testLinkToDocRoot($app, $file, $args, $expectedResult) {
- \OC::$WEBROOT = '';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
- $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
- $result = $urlGenerator->linkTo($app, $file, $args);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- /**
- * @small
- * test linkTo URL construction in sub directory
- * @dataProvider provideSubDirAppUrlParts
- */
- public function testLinkToSubDir($app, $file, $args, $expectedResult) {
- \OC::$WEBROOT = '/owncloud';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
- $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
- $result = $urlGenerator->linkTo($app, $file, $args);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- /**
- * @dataProvider provideRoutes
- */
- public function testLinkToRouteAbsolute($route, $expected) {
- \OC::$WEBROOT = '/owncloud';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
- $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
- $result = $urlGenerator->linkToRouteAbsolute($route);
- $this->assertEquals($expected, $result);
-
- }
-
- public function provideRoutes() {
- return array(
- 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', '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', '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'),
- );
- }
-
- /**
- * @small
- * test absolute URL construction
- * @dataProvider provideDocRootURLs
- */
- function testGetAbsoluteURLDocRoot($url, $expectedResult) {
-
- \OC::$WEBROOT = '';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
- $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
- $result = $urlGenerator->getAbsoluteURL($url);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- /**
- * @small
- * test absolute URL construction
- * @dataProvider provideSubDirURLs
- */
- function testGetAbsoluteURLSubDir($url, $expectedResult) {
-
- \OC::$WEBROOT = '/owncloud';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
- $urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
- $result = $urlGenerator->getAbsoluteURL($url);
-
- $this->assertEquals($expectedResult, $result);
- }
-
- public function provideDocRootURLs() {
- return array(
- array("index.php", "http://localhost/index.php"),
- array("/index.php", "http://localhost/index.php"),
- array("/apps/index.php", "http://localhost/apps/index.php"),
- array("apps/index.php", "http://localhost/apps/index.php"),
- );
- }
-
- public function provideSubDirURLs() {
- return array(
- array("index.php", "http://localhost/owncloud/index.php"),
- array("/index.php", "http://localhost/owncloud/index.php"),
- array("/apps/index.php", "http://localhost/owncloud/apps/index.php"),
- array("apps/index.php", "http://localhost/owncloud/apps/index.php"),
- );
- }
-}
-
/**
* Tests for server check functions
+ *
+ * @group DB
*/
class Test_Util_CheckServer extends \Test\TestCase {