1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SilverStripe\View\Tests\Embed; |
4
|
|
|
|
5
|
|
|
use Psr\Http\Message\RequestInterface; |
6
|
|
|
use Psr\Http\Message\UriInterface; |
7
|
|
|
use Psr\Http\Message\StreamInterface; |
8
|
|
|
|
9
|
|
|
class MockRequest implements RequestInterface |
10
|
|
|
{ |
11
|
|
|
private EmbedUnitTest $unitTest; |
12
|
|
|
private MockUri $mockUri; |
13
|
|
|
|
14
|
|
|
public function __construct(EmbedUnitTest $unitTest, MockUri $mockUri) |
15
|
|
|
{ |
16
|
|
|
$this->unitTest = $unitTest; |
17
|
|
|
$this->mockUri = $mockUri; |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
public function getRequestTarget() |
21
|
|
|
{ |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function getMethod() |
25
|
|
|
{ |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function getUri() |
29
|
|
|
{ |
30
|
|
|
$this->unitTest->setFirstRequest(false); |
31
|
|
|
return $this->mockUri; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function getProtocolVersion() |
35
|
|
|
{ |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function getHeaders() |
39
|
|
|
{ |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function getHeader($name) |
43
|
|
|
{ |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function getHeaderLine($name) |
47
|
|
|
{ |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function getBody() |
51
|
|
|
{ |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function hasHeader($name) |
55
|
|
|
{ |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function withHeader($name, $value) |
59
|
|
|
{ |
60
|
|
|
return $this; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function withAddedHeader($name, $value) |
64
|
|
|
{ |
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function withoutHeader($name) |
69
|
|
|
{ |
70
|
|
|
return $this; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function withBody(StreamInterface $body) |
74
|
|
|
{ |
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function withProtocolVersion($version) |
79
|
|
|
{ |
80
|
|
|
return $this; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function withRequestTarget($requestTarget) |
84
|
|
|
{ |
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function withMethod($method) |
89
|
|
|
{ |
90
|
|
|
return $this; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
public function withUri(UriInterface $uri, $preserveHost = false) |
94
|
|
|
{ |
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|