aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Grosser <development@stp-ip.net>2016-11-02 17:00:24 +0000
committerGitHub <noreply@github.com>2016-11-02 17:00:24 +0000
commite81d04cd8d2ac0de3d06d4586550469384c5d91a (patch)
tree0e243d105db3e00f1d3f899b9ecfbd73f3d98235 /apps
parent23dd62b653e42201468f9bed369a5993dea876b0 (diff)
parent0eeef26a8e2515b802015fe09bef7909aa183491 (diff)
downloadnextcloud-server-e81d04cd8d2ac0de3d06d4586550469384c5d91a.tar.gz
nextcloud-server-e81d04cd8d2ac0de3d06d4586550469384c5d91a.zip
Merge pull request #1940 from nextcloud/new-appstore
Use new appstore API
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/tests/UpdaterTest.php3
-rw-r--r--apps/provisioning_api/lib/Controller/AppsController.php9
-rw-r--r--apps/provisioning_api/tests/Controller/AppsControllerTest.php20
-rw-r--r--apps/updatenotification/lib/Notification/BackgroundJob.php3
4 files changed, 8 insertions, 27 deletions
diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php
index da292826f0a..bb320336d48 100644
--- a/apps/files_sharing/tests/UpdaterTest.php
+++ b/apps/files_sharing/tests/UpdaterTest.php
@@ -71,7 +71,8 @@ class UpdaterTest extends TestCase {
*/
function testDeleteParentFolder() {
$status = \OC_App::isEnabled('files_trashbin');
- \OC_App::enable('files_trashbin');
+ (new \OC_App())->enable('files_trashbin');
+
\OCA\Files_Trashbin\Trashbin::registerHooks();
diff --git a/apps/provisioning_api/lib/Controller/AppsController.php b/apps/provisioning_api/lib/Controller/AppsController.php
index 3821fc343ad..7d11d92b55a 100644
--- a/apps/provisioning_api/lib/Controller/AppsController.php
+++ b/apps/provisioning_api/lib/Controller/AppsController.php
@@ -37,25 +37,20 @@ use OCP\IRequest;
class AppsController extends OCSController {
/** @var \OCP\App\IAppManager */
private $appManager;
- /** @var OCSClient */
- private $ocsClient;
/**
* @param string $appName
* @param IRequest $request
* @param IAppManager $appManager
- * @param OCSClient $ocsClient
*/
public function __construct(
$appName,
IRequest $request,
- IAppManager $appManager,
- OCSClient $ocsClient
+ IAppManager $appManager
) {
parent::__construct($appName, $request);
$this->appManager = $appManager;
- $this->ocsClient = $ocsClient;
}
/**
@@ -64,7 +59,7 @@ class AppsController extends OCSController {
* @throws OCSException
*/
public function getApps($filter = null) {
- $apps = OC_App::listAllApps(false, true, $this->ocsClient);
+ $apps = (new OC_App())->listAllApps();
$list = [];
foreach($apps as $app) {
$list[] = $app['id'];
diff --git a/apps/provisioning_api/tests/Controller/AppsControllerTest.php b/apps/provisioning_api/tests/Controller/AppsControllerTest.php
index 9ac4a8290e4..c891433258f 100644
--- a/apps/provisioning_api/tests/Controller/AppsControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/AppsControllerTest.php
@@ -48,8 +48,6 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
private $api;
/** @var IUserSession */
private $userSession;
- /** @var OCSClient|\PHPUnit_Framework_MockObject_MockObject */
- private $ocsClient;
protected function setUp() {
parent::setUp();
@@ -57,9 +55,6 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
$this->appManager = \OC::$server->getAppManager();
$this->groupManager = \OC::$server->getGroupManager();
$this->userSession = \OC::$server->getUserSession();
- $this->ocsClient = $this->getMockBuilder('OC\OCSClient')
- ->disableOriginalConstructor()
- ->getMock();
$request = $this->getMockBuilder('OCP\IRequest')
->disableOriginalConstructor()
@@ -68,8 +63,7 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
$this->api = new AppsController(
'provisioning_api',
$request,
- $this->appManager,
- $this->ocsClient
+ $this->appManager
);
}
@@ -88,10 +82,6 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
}
public function testGetApps() {
- $this->ocsClient
- ->expects($this->any())
- ->method($this->anything())
- ->will($this->returnValue(null));
$user = $this->generateUsers();
$this->groupManager->get('admin')->addUser($user);
$this->userSession->setUser($user);
@@ -99,7 +89,7 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
$result = $this->api->getApps();
$data = $result->getData();
- $this->assertEquals(count(\OC_App::listAllApps(false, true, $this->ocsClient)), count($data['apps']));
+ $this->assertEquals(count((new \OC_App())->listAllApps()), count($data['apps']));
}
public function testGetAppsEnabled() {
@@ -109,13 +99,9 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
}
public function testGetAppsDisabled() {
- $this->ocsClient
- ->expects($this->any())
- ->method($this->anything())
- ->will($this->returnValue(null));
$result = $this->api->getApps('disabled');
$data = $result->getData();
- $apps = \OC_App::listAllApps(false, true, $this->ocsClient);
+ $apps = (new \OC_App)->listAllApps();
$list = array();
foreach($apps as $app) {
$list[] = $app['id'];
diff --git a/apps/updatenotification/lib/Notification/BackgroundJob.php b/apps/updatenotification/lib/Notification/BackgroundJob.php
index 3a1aa5e0f16..7bcc0e86905 100644
--- a/apps/updatenotification/lib/Notification/BackgroundJob.php
+++ b/apps/updatenotification/lib/Notification/BackgroundJob.php
@@ -22,7 +22,6 @@
namespace OCA\UpdateNotification\Notification;
-
use OC\BackgroundJob\TimedJob;
use OC\Installer;
use OC\Updater\VersionCheck;
@@ -215,6 +214,6 @@ class BackgroundJob extends TimedJob {
* @return string|false
*/
protected function isUpdateAvailable($app) {
- return Installer::isUpdateAvailable($app);
+ return Installer::isUpdateAvailable($app, \OC::$server->getAppFetcher());
}
}