diff --git a/apps/federation/api/ocsauthapi.php b/apps/federation/lib/API/OCSAuthAPI.php similarity index 100% rename from apps/federation/api/ocsauthapi.php rename to apps/federation/lib/API/OCSAuthAPI.php diff --git a/apps/federation/appinfo/application.php b/apps/federation/lib/AppInfo/Application.php similarity index 100% rename from apps/federation/appinfo/application.php rename to apps/federation/lib/AppInfo/Application.php diff --git a/apps/federation/backgroundjob/getsharedsecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php similarity index 100% rename from apps/federation/backgroundjob/getsharedsecret.php rename to apps/federation/lib/BackgroundJob/GetSharedSecret.php diff --git a/apps/federation/backgroundjob/requestsharedsecret.php b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php similarity index 100% rename from apps/federation/backgroundjob/requestsharedsecret.php rename to apps/federation/lib/BackgroundJob/RequestSharedSecret.php diff --git a/apps/federation/command/syncfederationaddressbooks.php b/apps/federation/lib/Command/SyncFederationAddressBooks.php similarity index 100% rename from apps/federation/command/syncfederationaddressbooks.php rename to apps/federation/lib/Command/SyncFederationAddressBooks.php diff --git a/apps/federation/controller/settingscontroller.php b/apps/federation/lib/Controller/SettingsController.php similarity index 100% rename from apps/federation/controller/settingscontroller.php rename to apps/federation/lib/Controller/SettingsController.php diff --git a/apps/federation/dav/fedauth.php b/apps/federation/lib/DAV/FedAuth.php similarity index 100% rename from apps/federation/dav/fedauth.php rename to apps/federation/lib/DAV/FedAuth.php diff --git a/apps/federation/lib/dbhandler.php b/apps/federation/lib/DbHandler.php similarity index 100% rename from apps/federation/lib/dbhandler.php rename to apps/federation/lib/DbHandler.php diff --git a/apps/federation/lib/hooks.php b/apps/federation/lib/Hooks.php similarity index 100% rename from apps/federation/lib/hooks.php rename to apps/federation/lib/Hooks.php diff --git a/apps/federation/middleware/addservermiddleware.php b/apps/federation/lib/Middleware/AddServerMiddleware.php similarity index 98% rename from apps/federation/middleware/addservermiddleware.php rename to apps/federation/lib/Middleware/AddServerMiddleware.php index 15781251349067795c011c06c45d4e3faba7e0c7..4b752f51ee40155abf7714c9acb6ebc1cd9019f8 100644 --- a/apps/federation/middleware/addservermiddleware.php +++ b/apps/federation/lib/Middleware/AddServerMiddleware.php @@ -20,7 +20,7 @@ * */ -namespace OCA\Federation\Middleware ; +namespace OCA\Federation\Middleware; use OC\HintException; use OCP\AppFramework\Http; diff --git a/apps/federation/lib/syncfederationaddressbooks.php b/apps/federation/lib/SyncFederationAddressBooks.php similarity index 100% rename from apps/federation/lib/syncfederationaddressbooks.php rename to apps/federation/lib/SyncFederationAddressBooks.php diff --git a/apps/federation/lib/syncjob.php b/apps/federation/lib/SyncJob.php similarity index 100% rename from apps/federation/lib/syncjob.php rename to apps/federation/lib/SyncJob.php diff --git a/apps/federation/lib/trustedservers.php b/apps/federation/lib/TrustedServers.php similarity index 100% rename from apps/federation/lib/trustedservers.php rename to apps/federation/lib/TrustedServers.php diff --git a/apps/federation/tests/api/ocsauthapitest.php b/apps/federation/tests/API/OCSAuthAPITest.php similarity index 100% rename from apps/federation/tests/api/ocsauthapitest.php rename to apps/federation/tests/API/OCSAuthAPITest.php diff --git a/apps/federation/tests/backgroundjob/getsharedsecrettest.php b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php similarity index 100% rename from apps/federation/tests/backgroundjob/getsharedsecrettest.php rename to apps/federation/tests/BackgroundJob/GetSharedSecretTest.php diff --git a/apps/federation/tests/backgroundjob/requestsharedsecrettest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php similarity index 96% rename from apps/federation/tests/backgroundjob/requestsharedsecrettest.php rename to apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php index 5b4a1f87a5f61fa644a131f956203ce440712308..2fc4fe881a6bba427832e181e1d87dbccec9d254 100644 --- a/apps/federation/tests/backgroundjob/requestsharedsecrettest.php +++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php @@ -24,7 +24,13 @@ namespace OCA\Federation\Tests\BackgroundJob; use OCA\Federation\BackgroundJob\RequestSharedSecret; +use OCA\Federation\DbHandler; +use OCA\Federation\TrustedServers; use OCP\AppFramework\Http; +use OCP\BackgroundJob\IJobList; +use OCP\Http\Client\IClient; +use OCP\Http\Client\IResponse; +use OCP\IURLGenerator; use Test\TestCase; class RequestSharedSecretTest extends TestCase { diff --git a/apps/federation/tests/controller/settingscontrollertest.php b/apps/federation/tests/Controller/SettingsControllerTest.php similarity index 100% rename from apps/federation/tests/controller/settingscontrollertest.php rename to apps/federation/tests/Controller/SettingsControllerTest.php diff --git a/apps/federation/tests/dav/fedauthtest.php b/apps/federation/tests/DAV/FedAuthTest.php similarity index 100% rename from apps/federation/tests/dav/fedauthtest.php rename to apps/federation/tests/DAV/FedAuthTest.php diff --git a/apps/federation/tests/lib/dbhandlertest.php b/apps/federation/tests/DbHandlerTest.php similarity index 99% rename from apps/federation/tests/lib/dbhandlertest.php rename to apps/federation/tests/DbHandlerTest.php index 3ded486d36af23ef15f65eea1e02a51f9d42c064..6e5b8f2f06cc17c5d58b95b94f2d19f38d521ce3 100644 --- a/apps/federation/tests/lib/dbhandlertest.php +++ b/apps/federation/tests/DbHandlerTest.php @@ -21,7 +21,7 @@ */ -namespace OCA\Federation\Tests\lib; +namespace OCA\Federation\Tests; use OCA\Federation\DbHandler; diff --git a/apps/federation/tests/lib/hookstest.php b/apps/federation/tests/HooksTest.php similarity index 98% rename from apps/federation/tests/lib/hookstest.php rename to apps/federation/tests/HooksTest.php index 71569226dd29c50c559c08f7317da7de44e1db2a..014829d9cf61add45871a28b0484e5a834ba0889 100644 --- a/apps/federation/tests/lib/hookstest.php +++ b/apps/federation/tests/HooksTest.php @@ -20,7 +20,7 @@ */ -namespace OCA\Federation\Tests\lib; +namespace OCA\Federation\Tests; use OCA\Federation\Hooks; diff --git a/apps/federation/tests/middleware/addservermiddlewaretest.php b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php similarity index 100% rename from apps/federation/tests/middleware/addservermiddlewaretest.php rename to apps/federation/tests/Middleware/AddServerMiddlewareTest.php diff --git a/apps/federation/tests/lib/syncfederationaddressbookstest.php b/apps/federation/tests/SyncFederationAddressbooksTest.php similarity index 95% rename from apps/federation/tests/lib/syncfederationaddressbookstest.php rename to apps/federation/tests/SyncFederationAddressbooksTest.php index aa2bd9ac2cbccd3e7feced5443c64c164f9849b2..4c266fae3a090e85ab39ebc4cfbdcdef2d80e551 100644 --- a/apps/federation/tests/lib/syncfederationaddressbookstest.php +++ b/apps/federation/tests/SyncFederationAddressbooksTest.php @@ -20,7 +20,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -namespace OCA\Federation\Tests\lib; +namespace OCA\Federation\Tests; use OCA\Federation\DbHandler; use OCA\Federation\SyncFederationAddressBooks; @@ -52,6 +52,7 @@ class SyncFederationAddressbooksTest extends \Test\TestCase { $syncService->expects($this->once())->method('syncRemoteAddressBook') ->willReturn(1); + /** @var \OCA\DAV\CardDAV\SyncService $syncService */ $s = new SyncFederationAddressBooks($dbHandler, $syncService); $s->syncThemAll(function($url, $ex) { $this->callBacks[] = [$url, $ex]; @@ -79,6 +80,7 @@ class SyncFederationAddressbooksTest extends \Test\TestCase { $syncService->expects($this->once())->method('syncRemoteAddressBook') ->willThrowException(new \Exception('something did not work out')); + /** @var \OCA\DAV\CardDAV\SyncService $syncService */ $s = new SyncFederationAddressBooks($dbHandler, $syncService); $s->syncThemAll(function($url, $ex) { $this->callBacks[] = [$url, $ex]; diff --git a/apps/federation/tests/lib/trustedserverstest.php b/apps/federation/tests/TrustedServersTest.php similarity index 96% rename from apps/federation/tests/lib/trustedserverstest.php rename to apps/federation/tests/TrustedServersTest.php index a8c7c7afb1f1aadb064ad5a0aae0ef0a686d47d5..e49db2556be1b2cf0118039e347a691e925d1963 100644 --- a/apps/federation/tests/lib/trustedserverstest.php +++ b/apps/federation/tests/TrustedServersTest.php @@ -21,7 +21,7 @@ */ -namespace OCA\Federation\Tests\lib; +namespace OCA\Federation\Tests; use OCA\Federation\DbHandler; @@ -38,7 +38,7 @@ use Test\TestCase; class TrustedServersTest extends TestCase { - /** @var TrustedServers */ + /** @var \PHPUnit_Framework_MockObject_MockObject | TrustedServers */ private $trustedServers; /** @var \PHPUnit_Framework_MockObject_MockObject | DbHandler */ @@ -101,7 +101,7 @@ class TrustedServersTest extends TestCase { * @param bool $success */ public function testAddServer($success) { - /** @var \PHPUnit_Framework_MockObject_MockObject | TrustedServers $trustedServer */ + /** @var \PHPUnit_Framework_MockObject_MockObject|TrustedServers $trustedServers */ $trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers') ->setConstructorArgs( [ @@ -172,7 +172,7 @@ class TrustedServersTest extends TestCase { ->with('federation', 'autoAddServers', '1')->willReturn($status); $this->assertSame($expected, - $this->trustedServers->getAutoAddServers($status) + $this->trustedServers->getAutoAddServers() ); } @@ -208,6 +208,7 @@ class TrustedServersTest extends TestCase { function($eventId, $event) { $this->assertSame($eventId, 'OCP\Federation\TrustedServerEvent::remove'); $this->assertInstanceOf('Symfony\Component\EventDispatcher\GenericEvent', $event); + /** @var \Symfony\Component\EventDispatcher\GenericEvent $event */ $this->assertSame('url_hash', $event->getSubject()); } ); @@ -215,9 +216,10 @@ class TrustedServersTest extends TestCase { } public function testGetServers() { - $this->dbHandler->expects($this->once())->method('getAllServer')->willReturn(true); + $this->dbHandler->expects($this->once())->method('getAllServer')->willReturn(['servers']); - $this->assertTrue( + $this->assertEquals( + ['servers'], $this->trustedServers->getServers() ); } @@ -257,7 +259,7 @@ class TrustedServersTest extends TestCase { $server = 'server1'; - /** @var \PHPUnit_Framework_MockObject_MockObject | TrustedServers $trustedServer */ + /** @var \PHPUnit_Framework_MockObject_MockObject | TrustedServers $trustedServers */ $trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers') ->setConstructorArgs( [