GrommunioCardDavBackendTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 3 1
A testConstruct() 0 2 1
A setUp() 0 4 1
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-only
4
 * SPDX-FileCopyrightText: Copyright 2016 - 2018 Kopano b.v.
5
 * SPDX-FileCopyrightText: Copyright 2020 grommunio GmbH
6
 *
7
 * Tests for grommunio Card DAV backend class which handles
8
 * contact related activities.
9
 */
10
11
namespace grommunio\DAV;
12
13
/**
14
 * @internal
15
 *
16
 * @coversNothing
17
 */
18
class GrommunioCardDavBackendTest extends \PHPUnit_Framework_TestCase {
0 ignored issues
show
Bug introduced by
The type PHPUnit_Framework_TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
	private $gDavBackendMock;
20
	private $kCardDavBackend;
21
22
	/**
23
	 * {@inheritDoc}
24
	 *
25
	 * @see PHPUnit_Framework_TestCase::setUp()
26
	 */
27
	protected function setUp() {
28
		$gloggerMock = $this->getMockBuilder(GLogger::class)->disableOriginalConstructor()->getMock();
29
		$this->gDavBackendMock = $this->getMockBuilder(GrommunioDavBackend::class)->disableOriginalConstructor()->getMock();
30
		$this->kCardDavBackend = new GrommunioCardDavBackend($this->gDavBackendMock, $gloggerMock);
31
	}
32
33
	/**
34
	 * {@inheritDoc}
35
	 *
36
	 * @see PHPUnit_Framework_TestCase::tearDown()
37
	 */
38
	protected function tearDown() {
39
		$this->kCardDavBackend = null;
40
		$this->gDavBackendMock = null;
41
	}
42
43
	/**
44
	 * Tests if the constructor is created without errors.
45
	 */
46
	public function testConstruct() {
47
		$this->assertTrue(is_object($this->kCardDavBackend));
48
	}
49
}
50