Skip to content

Commit

Permalink
Move OCS Provider to PSR-4 namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen committed May 19, 2016
1 parent 7ca5b35 commit 20f229e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions ocs-provider/provider.php → lib/private/OCS/Provider.php
Expand Up @@ -19,6 +19,8 @@
*
*/

namespace OC\OCS;

class Provider extends \OCP\AppFramework\Controller {
/** @var \OCP\App\IAppManager */
private $appManager;
Expand Down
3 changes: 1 addition & 2 deletions ocs-provider/index.php
Expand Up @@ -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()
Expand Down
10 changes: 6 additions & 4 deletions tests/ocs/response.php → tests/lib/ocs/MapStatusCodeTest.php
@@ -1,6 +1,4 @@
<?php
use OCP\AppFramework\Http;

/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
Expand All @@ -21,13 +19,17 @@
*
*/

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);
}

Expand Down
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down

0 comments on commit 20f229e

Please sign in to comment.