Code Duplication    Length = 5-5 lines in 3 locations

build/integration/features/bootstrap/BasicStructure.php 1 location

@@ 129-133 (lines=5) @@
126
		$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php" . $url;
127
		$client = new Client();
128
		$options = [];
129
		if ($this->currentUser === 'admin') {
130
			$options['auth'] = $this->adminUser;
131
		} else {
132
			$options['auth'] = [$this->currentUser, $this->regularUser];
133
		}
134
		if ($body instanceof \Behat\Gherkin\Node\TableNode) {
135
			$fd = $body->getRowsHash();
136
			$options['body'] = $fd;

build/integration/features/bootstrap/Sharing.php 2 locations

@@ 119-123 (lines=5) @@
116
		$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
117
		$client = new Client();
118
		$options = [];
119
		if ($this->currentUser === 'admin') {
120
			$options['auth'] = $this->adminUser;
121
		} else {
122
			$options['auth'] = [$this->currentUser, $this->regularUser];
123
		}
124
		$date = date('Y-m-d', strtotime("+3 days"));
125
		$options['body'] = ['expireDate' => $date];
126
		$this->response = $client->send($client->createRequest("PUT", $fullUrl, $options));
@@ 139-143 (lines=5) @@
136
		$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/apps/files_sharing/api/v{$this->sharingApiVersion}/shares/$share_id";
137
		$client = new Client();
138
		$options = [];
139
		if ($this->currentUser === 'admin') {
140
			$options['auth'] = $this->adminUser;
141
		} else {
142
			$options['auth'] = [$this->currentUser, $this->regularUser];
143
		}
144
145
		if ($body instanceof \Behat\Gherkin\Node\TableNode) {
146
			$fd = $body->getRowsHash();