Code Duplication    Length = 8-13 lines in 6 locations

apps/files_sharing/tests/middleware/sharingcheckmiddleware.php 1 location

@@ 75-83 (lines=9) @@
72
		$this->assertTrue(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
73
	}
74
75
	public function testIsSharingEnabledWithAppDisabled() {
76
		$this->appManager
77
			->expects($this->once())
78
			->method('isEnabledForUser')
79
			->with('files_sharing')
80
			->will($this->returnValue(false));
81
82
		$this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
83
	}
84
85
	public function testIsLinkSharingEnabledWithEverythinEnabled() {
86
		$this->config

tests/lib/ocsclienttest.php 1 location

@@ 64-71 (lines=8) @@
61
		$this->assertTrue($this->ocsClient->isAppStoreEnabled());
62
	}
63
64
	public function testIsAppStoreEnabledFail() {
65
		$this->config
66
			->expects($this->once())
67
			->method('getSystemValue')
68
			->with('appstoreenabled', true)
69
			->will($this->returnValue(false));
70
		$this->assertFalse($this->ocsClient->isAppStoreEnabled());
71
	}
72
73
	public function testGetAppStoreUrl() {
74
		$this->config

tests/settings/controller/CheckSetupControllerTest.php 4 locations

@@ 102-114 (lines=13) @@
99
			->setMethods(['getCurlVersion'])->getMock();
100
	}
101
102
	public function testIsInternetConnectionWorkingDisabledViaConfig() {
103
		$this->config->expects($this->once())
104
			->method('getSystemValue')
105
			->with('has_internet_connection', true)
106
			->will($this->returnValue(false));
107
108
		$this->assertFalse(
109
			self::invokePrivate(
110
				$this->checkSetupController,
111
				'isInternetConnectionWorking'
112
			)
113
		);
114
	}
115
116
	public function testIsInternetConnectionWorkingCorrectly() {
117
		$this->config->expects($this->once())
@@ 197-209 (lines=13) @@
194
		);
195
	}
196
197
	public function testIsMemcacheConfiguredFalse() {
198
		$this->config->expects($this->once())
199
			->method('getSystemValue')
200
			->with('memcache.local', null)
201
			->will($this->returnValue(null));
202
203
		$this->assertFalse(
204
			self::invokePrivate(
205
				$this->checkSetupController,
206
				'isMemcacheConfigured'
207
			)
208
		);
209
	}
210
211
	public function testIsMemcacheConfiguredTrue() {
212
		$this->config->expects($this->once())
@@ 211-223 (lines=13) @@
208
		);
209
	}
210
211
	public function testIsMemcacheConfiguredTrue() {
212
		$this->config->expects($this->once())
213
			->method('getSystemValue')
214
			->with('memcache.local', null)
215
			->will($this->returnValue('SomeProvider'));
216
217
		$this->assertTrue(
218
			self::invokePrivate(
219
				$this->checkSetupController,
220
				'isMemcacheConfigured'
221
			)
222
		);
223
	}
224
225
	public function testIsPhpSupportedFalse() {
226
		self::$version_compare = -1;
@@ 521-528 (lines=8) @@
518
		$this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
519
	}
520
521
	public function testIsUsedTlsLibOutdatedWithInternetDisabled() {
522
		$this->config
523
			->expects($this->at(0))
524
			->method('getSystemValue')
525
			->with('has_internet_connection', true)
526
			->will($this->returnValue(false));
527
		$this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
528
	}
529
530
	public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingEnabled() {
531
		// Appstore is disabled by default in EE