Completed
Push — master ( dfd9fa...12a57f )
by Raimund
30s queued 10s
created

AppTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAppInstalled() 0 4 1
A testNavigation() 0 8 1
1
<?php
2
/**
3
 * Nextcloud - Tasks
4
 *
5
 * @author Julius Härtl
6
 * @copyright 2016 Julius Härtl <[email protected]>
7
 *
8
 * @author Raimund Schlüßler
9
 * @copyright 2019 Raimund Schlüßler <[email protected]>
10
 *
11
 * This library is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
13
 * License as published by the Free Software Foundation; either
14
 * version 3 of the License, or any later version.
15
 *
16
 * This library is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
20
 *
21
 * You should have received a copy of the GNU Affero General Public
22
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
23
 *
24
 */
25
26
use OCP\AppFramework\App;
27
use PHPUnit\Framework\TestCase;
28
29
class AppTest extends TestCase {
30
31
	private $container;
32
	private $app;
33
34
	public function setUp(): void {
35
		parent::setUp();
36
		$this->app = new \OCA\Tasks\AppInfo\Application();
37
		$this->container = $this->app->getContainer();
38
	}
39
40
	public function testAppInstalled() {
41
		$appManager = $this->container->query('OCP\App\IAppManager');
42
		$this->assertTrue($appManager->isInstalled('tasks'));
43
	}
44
45
	public function testNavigation() {
46
		$navigationManager = \OC::$server->getNavigationManager();
47
		$navigationManager->clear();
48
		$countBefore = count($navigationManager->getAll());
49
		require __DIR__ . '/../../../appinfo/app.php';
50
		// Test whether the navigation entry got added
51
		$this->assertCount($countBefore + 1, $navigationManager->getAll());
52
	}
53
54
}
55