Skip to content

Commit

Permalink
Merge branch 'pr/30' into master-NC27
Browse files Browse the repository at this point in the history
  • Loading branch information
leonvandebroek committed Sep 16, 2024
2 parents 62e674a + d9d4a54 commit 8259d73
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
name: PHP Tests

on:
pull_request:
push:
branches:
- master
on: [push, pull_request]

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.4']
nextcloud-versions: ['stable20', 'stable21', 'stable22']
php-versions: ['8']
nextcloud-versions: ['stable26', 'stable27']
include:
- php-versions: '7.2'
nextcloud-versions: 'stable20'
- php-versions: '8'
nextcloud-versions: 'stable22'
- php-versions: '7.4'
nextcloud-versions: 'stable25'

name: php${{ matrix.php-versions }} on ${{ matrix.nextcloud-versions }} unit tests
env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
- name: Install dependencies
run: yarn install
- name: Build bundle
Expand Down
29 changes: 28 additions & 1 deletion tests/Unit/Settings/SendentSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

use OCA\Sendent\Constants;
use OCA\Sendent\Settings\SendentSettings;
use OCA\Sendent\Service\LicenseManager;
use OCA\Sendent\Service\LicenseService;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\TagNotFoundException;
use PHPUnit\Framework\MockObject\MockObject;
Expand All @@ -27,6 +30,15 @@ class SendentSettingsTest extends TestCase {
/** @var MockObject */
private $tagManager;

/** @var MockObject */
private $l;

/** @var MockObject */
private $licenseManager;

/** @var MockObject */
private $licenseService;

/** @var SendentSettings */
private $settings;

Expand All @@ -41,13 +53,28 @@ public function setUp(): void {
$this->appConfig = $this->getMockBuilder(IAppConfig::class)->getMock();
/** @var ISystemTagManager */
$this->tagManager = $this->getMockBuilder(ISystemTagManager::class)->getMock();
/** @var IL10N */
$this->l = $this->getMockBuilder(IL10N::class)->getMock();
/** @var LicenseManager */
$this->licenseManager = $this->getMockBuilder(LicenseManager::class)
->disableOriginalConstructor()
->getMock();
/** @var LicenseService */
$this->licenseService = $this->getMockBuilder(LicenseService::class)
->disableOriginalConstructor()
->getMock();
$this->licenseService->method('findByGroup')
->willReturn([]);

$this->settings = new SendentSettings(
$this->appManager,
$this->groupManager,
$this->initialState,
$this->appConfig,
$this->tagManager
$this->tagManager,
$this->l,
$this->licenseManager,
$this->licenseService
);
}

Expand Down

0 comments on commit 8259d73

Please sign in to comment.