diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index bb3bbf520..4b10ae9e1 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -26,8 +26,8 @@ jobs: uses: skjnldsv/read-package-engines-version-actions@v1.2 id: versions with: - fallbackNode: '^12' - fallbackNpm: '^6' + fallbackNode: '^14' + fallbackNpm: '^7' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} uses: actions/setup-node@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51564b75c..8b95065ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: 12.x - - name: npm install - run: npm install + - name: npm ci + run: npm ci env: CI: true diff --git a/tests/Unit/Controller/ContactsControllerTest.php b/tests/Unit/Controller/ContactsControllerTest.php index 1cf591e70..70bafceb5 100644 --- a/tests/Unit/Controller/ContactsControllerTest.php +++ b/tests/Unit/Controller/ContactsControllerTest.php @@ -19,6 +19,7 @@ use OCA\Maps\Service\AddressService; use OCP\Files\IAppData; use \OCP\IServerContainer; +use \OCP\EventDispatcher\IEventDispatcher; use \OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\CardDAV\ContactsManager; @@ -98,7 +99,7 @@ protected function setUp(): void { ->getMock(); $this->addressService = new AddressService( - $c->query(IServerContainer::class)->getConfig(), + $c->query(IServerContainer::class)->getMemCacheFactory(), $c->query(IServerContainer::class)->getLogger(), $c->query(IServerContainer::class)->getJobList(), $this->appData, @@ -122,7 +123,7 @@ protected function setUp(): void { $this->userPrincipalBackend, $c->getServer()->getUserManager(), $c->getServer()->getGroupManager(), - $c->getServer()->getEventDispatcher() + $c->query(IServerContainer::class)->query(IEventDispatcher::class) ); $this->contactsController = new ContactsController( diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php index af4074362..464c3983f 100644 --- a/tests/Unit/Controller/PageControllerTest.php +++ b/tests/Unit/Controller/PageControllerTest.php @@ -12,7 +12,8 @@ namespace OCA\Maps\Controller; use \OCA\Maps\AppInfo\Application; -use OCP\AppFramework\Http\TemplateResponse; +use \OCP\AppFramework\Http\TemplateResponse; +use \OCP\EventDispatcher\IEventDispatcher; use \OCP\IServerContainer; @@ -20,6 +21,7 @@ class PageControllerTest extends \PHPUnit\Framework\TestCase { private $controller; private $userId = 'john'; private $config; + private $eventDispatcher; private $app; private $container; @@ -30,12 +32,13 @@ protected function setUp(): void { $this->container = $this->app->getContainer(); $c = $this->container; $this->config = $c->query(IServerContainer::class)->getConfig(); + $this->eventDispatcher = $c->query(IServerContainer::class)->query(IEventDispatcher::class); $this->oldGHValue = $this->config->getAppValue('maps', 'graphhopperURL'); $this->config->setAppValue('maps', 'graphhopperURL', 'https://graphhopper.com:8080'); $this->controller = new PageController( - 'maps', $request, $this->config, $initialStateService, $this->userId + 'maps', $request, $this->eventDispatcher, $this->config, $initialStateService, $this->userId ); }