Code Duplication    Length = 18-26 lines in 2 locations

apps/encryption/tests/lib/crypto/cryptTest.php 1 location

@@ 45-62 (lines=18) @@
42
	/** @var  Crypt */
43
	private $crypt;
44
45
	public function setUp() {
46
		parent::setUp();
47
48
		$this->logger = $this->getMockBuilder('OCP\ILogger')
49
			->disableOriginalConstructor()
50
			->getMock();
51
		$this->logger->expects($this->any())
52
			->method('warning')
53
			->willReturn(true);
54
		$this->userSession = $this->getMockBuilder('OCP\IUserSession')
55
			->disableOriginalConstructor()
56
			->getMock();
57
		$this->config = $this->getMockBuilder('OCP\IConfig')
58
			->disableOriginalConstructor()
59
			->getMock();
60
61
		$this->crypt = new Crypt($this->logger, $this->userSession, $this->config);
62
	}
63
64
	/**
65
	 * test getOpenSSLConfig without any additional parameters

tests/lib/encryption/utiltest.php 1 location

@@ 32-57 (lines=26) @@
29
	/** @var  \OC\Encryption\Util */
30
	private $util;
31
32
	public function setUp() {
33
		parent::setUp();
34
		$this->view = $this->getMockBuilder('OC\Files\View')
35
			->disableOriginalConstructor()
36
			->getMock();
37
38
		$this->userManager = $this->getMockBuilder('OC\User\Manager')
39
			->disableOriginalConstructor()
40
			->getMock();
41
42
		$this->groupManager = $this->getMockBuilder('OC\Group\Manager')
43
			->disableOriginalConstructor()
44
			->getMock();
45
46
		$this->config = $this->getMockBuilder('OCP\IConfig')
47
			->disableOriginalConstructor()
48
			->getMock();
49
50
		$this->util = new Util(
51
			$this->view,
52
			$this->userManager,
53
			$this->groupManager,
54
			$this->config
55
		);
56
57
	}
58
59
	/**
60
	 * @dataProvider providesHeadersForEncryptionModule