|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace EllipseSynergie\ApiResponse\Tests\Laravel; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class ResponseFactoryFake |
|
7
|
|
|
* @package EllipseSynergie\ApiResponse\Tests\Laravel |
|
8
|
|
|
* @author Maxime Beaudoin <[email protected]> |
|
9
|
|
|
*/ |
|
10
|
|
|
class ResponseFactoryFake implements \Illuminate\Contracts\Routing\ResponseFactory |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* Return a new response from the application. |
|
14
|
|
|
* |
|
15
|
|
|
* @param string $content |
|
16
|
|
|
* @param int $status |
|
17
|
|
|
* @param array $headers |
|
18
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
19
|
|
|
*/ |
|
20
|
|
|
public function make($content = '', $status = 200, array $headers = array()) |
|
21
|
|
|
{ |
|
22
|
|
|
// TODO: Implement make() method. |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Return a new view response from the application. |
|
27
|
|
|
* |
|
28
|
|
|
* @param string $view |
|
29
|
|
|
* @param array $data |
|
30
|
|
|
* @param int $status |
|
31
|
|
|
* @param array $headers |
|
32
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
33
|
|
|
*/ |
|
34
|
|
|
public function view($view, $data = array(), $status = 200, array $headers = array()) |
|
35
|
|
|
{ |
|
36
|
|
|
// TODO: Implement view() method. |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Return a new JSON response from the application. |
|
41
|
|
|
* |
|
42
|
|
|
* @param string|array $data |
|
43
|
|
|
* @param int $status |
|
44
|
|
|
* @param array $headers |
|
45
|
|
|
* @param int $options |
|
46
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
47
|
|
|
*/ |
|
48
|
|
|
public function json($data = array(), $status = 200, array $headers = array(), $options = 0) |
|
49
|
|
|
{ |
|
50
|
|
|
return $data; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Return a new JSONP response from the application. |
|
55
|
|
|
* |
|
56
|
|
|
* @param string $callback |
|
57
|
|
|
* @param string|array $data |
|
58
|
|
|
* @param int $status |
|
59
|
|
|
* @param array $headers |
|
60
|
|
|
* @param int $options |
|
61
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
62
|
|
|
*/ |
|
63
|
|
|
public function jsonp($callback, $data = array(), $status = 200, array $headers = array(), $options = 0) |
|
64
|
|
|
{ |
|
65
|
|
|
// TODO: Implement jsonp() method. |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* Return a new streamed response from the application. |
|
70
|
|
|
* |
|
71
|
|
|
* @param \Closure $callback |
|
72
|
|
|
* @param int $status |
|
73
|
|
|
* @param array $headers |
|
74
|
|
|
* @return \Symfony\Component\HttpFoundation\StreamedResponse |
|
75
|
|
|
*/ |
|
76
|
|
|
public function stream($callback, $status = 200, array $headers = array()) |
|
77
|
|
|
{ |
|
78
|
|
|
// TODO: Implement stream() method. |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* Create a new file download response. |
|
83
|
|
|
* |
|
84
|
|
|
* @param \SplFileInfo|string $file |
|
85
|
|
|
* @param string $name |
|
86
|
|
|
* @param array $headers |
|
87
|
|
|
* @param null|string $disposition |
|
88
|
|
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse |
|
89
|
|
|
*/ |
|
90
|
|
|
public function download($file, $name = null, array $headers = array(), $disposition = 'attachment') |
|
91
|
|
|
{ |
|
92
|
|
|
// TODO: Implement download() method. |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* Create a new redirect response to the given path. |
|
97
|
|
|
* |
|
98
|
|
|
* @param string $path |
|
99
|
|
|
* @param int $status |
|
100
|
|
|
* @param array $headers |
|
101
|
|
|
* @param bool $secure |
|
102
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
103
|
|
|
*/ |
|
104
|
|
|
public function redirectTo($path, $status = 302, $headers = array(), $secure = null) |
|
105
|
|
|
{ |
|
106
|
|
|
// TODO: Implement redirectTo() method. |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* Create a new redirect response to a named route. |
|
111
|
|
|
* |
|
112
|
|
|
* @param string $route |
|
113
|
|
|
* @param array $parameters |
|
114
|
|
|
* @param int $status |
|
115
|
|
|
* @param array $headers |
|
116
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
117
|
|
|
*/ |
|
118
|
|
|
public function redirectToRoute($route, $parameters = array(), $status = 302, $headers = array()) |
|
119
|
|
|
{ |
|
120
|
|
|
// TODO: Implement redirectToRoute() method. |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* Create a new redirect response to a controller action. |
|
125
|
|
|
* |
|
126
|
|
|
* @param string $action |
|
127
|
|
|
* @param array $parameters |
|
128
|
|
|
* @param int $status |
|
129
|
|
|
* @param array $headers |
|
130
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
131
|
|
|
*/ |
|
132
|
|
|
public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array()) |
|
133
|
|
|
{ |
|
134
|
|
|
// TODO: Implement redirectToAction() method. |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* Create a new redirect response, while putting the current URL in the session. |
|
139
|
|
|
* |
|
140
|
|
|
* @param string $path |
|
141
|
|
|
* @param int $status |
|
142
|
|
|
* @param array $headers |
|
143
|
|
|
* @param bool $secure |
|
144
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
145
|
|
|
*/ |
|
146
|
|
|
public function redirectGuest($path, $status = 302, $headers = array(), $secure = null) |
|
147
|
|
|
{ |
|
148
|
|
|
// TODO: Implement redirectGuest() method. |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* Create a new redirect response to the previously intended location. |
|
153
|
|
|
* |
|
154
|
|
|
* @param string $default |
|
155
|
|
|
* @param int $status |
|
156
|
|
|
* @param array $headers |
|
157
|
|
|
* @param bool $secure |
|
158
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
159
|
|
|
*/ |
|
160
|
|
|
public function redirectToIntended($default = '/', $status = 302, $headers = array(), $secure = null) |
|
161
|
|
|
{ |
|
162
|
|
|
// TODO: Implement redirectToIntended() method. |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
/** |
|
166
|
|
|
* Return a new streamed response as a file download from the application. |
|
167
|
|
|
* |
|
168
|
|
|
* @param \Closure $callback |
|
169
|
|
|
* @param string|null $name |
|
170
|
|
|
* @param array $headers |
|
171
|
|
|
* @param string|null $disposition |
|
172
|
|
|
* @return \Symfony\Component\HttpFoundation\StreamedResponse |
|
173
|
|
|
*/ |
|
174
|
|
|
public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment') |
|
175
|
|
|
{ |
|
176
|
|
|
// TODO: Implement streamDownload() method. |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* Create a new "no content" response. |
|
181
|
|
|
* |
|
182
|
|
|
* @param int $status |
|
183
|
|
|
* @param array $headers |
|
184
|
|
|
* @return \Illuminate\Http\Response |
|
185
|
|
|
*/ |
|
186
|
|
|
public function noContent($status = 204, array $headers = []) |
|
187
|
|
|
{ |
|
188
|
|
|
// TODO: Implement noContent() method. |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
/** |
|
192
|
|
|
* Return the raw contents of a binary file. |
|
193
|
|
|
* |
|
194
|
|
|
* @param \SplFileInfo|string $file |
|
195
|
|
|
* @param array $headers |
|
196
|
|
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse |
|
197
|
|
|
*/ |
|
198
|
|
|
public function file($file, array $headers = []) |
|
199
|
|
|
{ |
|
200
|
|
|
// TODO: Implement file() method. |
|
201
|
|
|
} |
|
202
|
|
|
} |
|
203
|
|
|
|