Code Duplication    Length = 25-25 lines in 2 locations

tests/lib/appframework/http/RequestTest.php 2 locations

@@ 912-936 (lines=25) @@
909
		$this->assertSame('my.trusted.host',  $request->getServerHost());
910
	}
911
912
	public function testGetServerHostWithUntrustedDomain() {
913
		$this->config
914
			->expects($this->at(3))
915
			->method('getSystemValue')
916
			->with('trusted_domains')
917
			->will($this->returnValue(['my.trusted.host']));
918
		$this->config
919
			->expects($this->at(4))
920
			->method('getSystemValue')
921
			->with('trusted_domains')
922
			->will($this->returnValue(['my.trusted.host']));
923
924
		$request = new Request(
925
			[
926
				'server' => [
927
					'HTTP_X_FORWARDED_HOST' => 'my.untrusted.host',
928
				],
929
			],
930
			$this->secureRandom,
931
			$this->config,
932
			$this->stream
933
		);
934
935
		$this->assertSame('my.trusted.host',  $request->getServerHost());
936
	}
937
938
	public function testGetServerHostWithNoTrustedDomain() {
939
		$this->config
@@ 938-962 (lines=25) @@
935
		$this->assertSame('my.trusted.host',  $request->getServerHost());
936
	}
937
938
	public function testGetServerHostWithNoTrustedDomain() {
939
		$this->config
940
			->expects($this->at(3))
941
			->method('getSystemValue')
942
			->with('trusted_domains')
943
			->will($this->returnValue([]));
944
		$this->config
945
			->expects($this->at(4))
946
			->method('getSystemValue')
947
			->with('trusted_domains')
948
			->will($this->returnValue([]));
949
950
		$request = new Request(
951
			[
952
				'server' => [
953
					'HTTP_X_FORWARDED_HOST' => 'my.untrusted.host',
954
				],
955
			],
956
			$this->secureRandom,
957
			$this->config,
958
			$this->stream
959
		);
960
961
		$this->assertSame('',  $request->getServerHost());
962
	}
963
964
	public function testGetOverwriteHostDefaultNull() {
965
		$this->config