/
LegacyMockInterface.php
230 lines (198 loc) · 5.61 KB
/
LegacyMockInterface.php
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?php
/**
* Mockery (https://docs.mockery.io/)
*
* @copyright https://github.com/mockery/mockery/blob/HEAD/COPYRIGHT.md
* @license https://github.com/mockery/mockery/blob/HEAD/LICENSE BSD 3-Clause License
* @link https://github.com/mockery/mockery for the canonical source repository
*/
namespace Mockery;
interface LegacyMockInterface
{
/**
* Alternative setup method to constructor
*
* @param \Mockery\Container $container
* @param object $partialObject
* @return void
*/
public function mockery_init(\Mockery\Container $container = null, $partialObject = null);
/**
* Set expected method calls
*
* @param string|array ...$methodNames one or many methods that are expected to be called in this mock
*
* @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
*/
public function shouldReceive(...$methodNames);
/**
* Shortcut method for setting an expectation that a method should not be called.
*
* @param string|array ...$methodNames one or many methods that are expected not to be called in this mock
* @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage
*/
public function shouldNotReceive(...$methodNames);
/**
* Allows additional methods to be mocked that do not explicitly exist on mocked class
* @param String $method name of the method to be mocked
*/
public function shouldAllowMockingMethod($method);
/**
* Set mock to ignore unexpected methods and return Undefined class
* @param mixed $returnValue the default return value for calls to missing functions on this mock
* @return static
*/
public function shouldIgnoreMissing($returnValue = null);
/**
* @return static
*/
public function shouldAllowMockingProtectedMethods();
/**
* Set mock to defer unexpected methods to its parent if possible
*
* @deprecated since 1.4.0. Please use makePartial() instead.
*
* @return static
*/
public function shouldDeferMissing();
/**
* Set mock to defer unexpected methods to its parent if possible
*
* @return static
*/
public function makePartial();
/**
* @param null|string $method
* @param null|array|Closure $args
* @return mixed
*/
public function shouldHaveReceived($method, $args = null);
/**
* @return mixed
*/
public function shouldHaveBeenCalled();
/**
* @param null|string $method
* @param null|array|Closure $args
* @return mixed
*/
public function shouldNotHaveReceived($method, $args = null);
/**
* @param array $args (optional)
* @return mixed
*/
public function shouldNotHaveBeenCalled(array $args = null);
/**
* In the event shouldReceive() accepting an array of methods/returns
* this method will switch them from normal expectations to default
* expectations
*
* @return self
*/
public function byDefault();
/**
* Iterate across all expectation directors and validate each
*
* @throws \Mockery\CountValidator\Exception
* @return void
*/
public function mockery_verify();
/**
* Tear down tasks for this mock
*
* @return void
*/
public function mockery_teardown();
/**
* Fetch the next available allocation order number
*
* @return int
*/
public function mockery_allocateOrder();
/**
* Set ordering for a group
*
* @param mixed $group
* @param int $order
*/
public function mockery_setGroup($group, $order);
/**
* Fetch array of ordered groups
*
* @return array
*/
public function mockery_getGroups();
/**
* Set current ordered number
*
* @param int $order
*/
public function mockery_setCurrentOrder($order);
/**
* Get current ordered number
*
* @return int
*/
public function mockery_getCurrentOrder();
/**
* Validate the current mock's ordering
*
* @param string $method
* @param int $order
* @throws \Mockery\Exception
* @return void
*/
public function mockery_validateOrder($method, $order);
/**
* Gets the count of expectations for this mock
*
* @return int
*/
public function mockery_getExpectationCount();
/**
* Return the expectations director for the given method
*
* @var string $method
* @return \Mockery\ExpectationDirector|null
*/
public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director);
/**
* Return the expectations director for the given method
*
* @var string $method
* @return \Mockery\ExpectationDirector|null
*/
public function mockery_getExpectationsFor($method);
/**
* Find an expectation matching the given method and arguments
*
* @var string $method
* @var array $args
* @return \Mockery\Expectation|null
*/
public function mockery_findExpectation($method, array $args);
/**
* Return the container for this mock
*
* @return \Mockery\Container
*/
public function mockery_getContainer();
/**
* Return the name for this mock
*
* @return string
*/
public function mockery_getName();
/**
* @return array
*/
public function mockery_getMockableProperties();
/**
* @return string[]
*/
public function mockery_getMockableMethods();
/**
* @return bool
*/
public function mockery_isAnonymous();
}