diff --git a/ocs-provider/provider.php b/lib/private/OCS/Provider.php similarity index 99% rename from ocs-provider/provider.php rename to lib/private/OCS/Provider.php index 396b5b23fc..4a7caa79fa 100644 --- a/ocs-provider/provider.php +++ b/lib/private/OCS/Provider.php @@ -19,6 +19,8 @@ * */ +namespace OC\OCS; + class Provider extends \OCP\AppFramework\Controller { /** @var \OCP\App\IAppManager */ private $appManager; diff --git a/ocs-provider/index.php b/ocs-provider/index.php index 316b39cace..20e27e38ce 100644 --- a/ocs-provider/index.php +++ b/ocs-provider/index.php @@ -20,13 +20,12 @@ */ require_once('../lib/base.php'); -require_once(__DIR__ . '/provider.php'); header('Content-Type: application/json'); $server = \OC::$server; -$controller = new Provider( +$controller = new \OC\OCS\Provider( 'ocs_provider', $server->getRequest(), $server->getAppManager() diff --git a/tests/ocs/response.php b/tests/lib/ocs/MapStatusCodeTest.php similarity index 90% rename from tests/ocs/response.php rename to tests/lib/ocs/MapStatusCodeTest.php index 919915a7c7..27ebfe209f 100644 --- a/tests/ocs/response.php +++ b/tests/lib/ocs/MapStatusCodeTest.php @@ -1,6 +1,4 @@ * @@ -21,13 +19,17 @@ use OCP\AppFramework\Http; * */ -class OcsResponseTest extends \Test\TestCase { +namespace Test\OCS; + +use OCP\AppFramework\Http; + +class MapStatusCodeTest extends \Test\TestCase { /** * @dataProvider providesStatusCodes */ public function testStatusCodeMapper($expected, $sc) { - $result = OC_API::mapStatusCodes($sc); + $result = \OC_API::mapStatusCodes($sc); $this->assertEquals($expected, $result); } diff --git a/tests/ocs-provider/provider.php b/tests/lib/ocs/ProviderTest.php similarity index 98% rename from tests/ocs-provider/provider.php rename to tests/lib/ocs/ProviderTest.php index 17f557b16b..399fd3933d 100644 --- a/tests/ocs-provider/provider.php +++ b/tests/lib/ocs/ProviderTest.php @@ -19,7 +19,11 @@ * */ -class OcsProviderTest extends \Test\TestCase { +namespace Test\OCS; + +use OC\OCS\Provider; + +class ProviderTest extends \Test\TestCase { /** @var \OCP\IRequest */ private $request; /** @var \OCP\App\IAppManager */ @@ -30,8 +34,6 @@ class OcsProviderTest extends \Test\TestCase { public function setUp() { parent::setUp(); - require_once '../ocs-provider/provider.php'; - $this->request = $this->getMockBuilder('\\OCP\\IRequest')->getMock(); $this->appManager = $this->getMockBuilder('\\OCP\\App\\IAppManager')->getMock(); $this->ocsProvider = new Provider('ocs_provider', $this->request, $this->appManager);