forked from mtierltd/timetracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRequestMock.php
More file actions
60 lines (34 loc) · 1.63 KB
/
RequestMock.php
File metadata and controls
60 lines (34 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace OCA\TimeTracker\Tests\Unit\Mock;
use OCP\IRequest;
class RequestMock implements IRequest
{
public $params = [];
public function __get($name) {
return $this->params[$name] ?? null;
}
public function __isset($name) {
return isset($this->params[$name]);
}
public function getHeader(string $name): string { return ""; }
public function getParam(string $key, $default = null) { return $this->params[$key] ?? $default; }
public function getParams(): array { return $this->params; }
public function getMethod(): string { return "GET"; }
public function getUploadedFile(string $key) { return null; }
public function getEnv(string $key) { return null; }
public function getCookie(string $key) { return null; }
public function passesCSRFCheck(): bool { return true; }
public function passesStrictCookieCheck(): bool { return true; }
public function passesLaxCookieCheck(): bool { return true; }
public function getId(): string { return ""; }
public function getRemoteAddress(): string { return ""; }
public function getServerProtocol(): string { return ""; }
public function getHttpProtocol(): string { return ""; }
public function getRequestUri(): string { return ""; }
public function getRawPathInfo(): string { return ""; }
public function getPathInfo(): string { return ""; }
public function getScriptName(): string { return ""; }
public function isUserAgent(array $agent): bool { return false; }
public function getInsecureServerHost(): string { return ""; }
public function getServerHost(): string { return ""; }
}