1 | <?php |
||
17 | trait ProxyTrait |
||
18 | { |
||
19 | /** |
||
20 | * @var object |
||
21 | */ |
||
22 | private $__moka_mock; |
||
23 | |||
24 | /** |
||
25 | * @var MockingStrategyInterface |
||
26 | */ |
||
27 | private $__moka_mockingStrategy; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | private $__moka_properties = []; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $__moka_methods = []; |
||
38 | |||
39 | /** |
||
40 | * @return object |
||
41 | */ |
||
42 | 4 | public function __moka_getMock() |
|
46 | |||
47 | /** |
||
48 | * @param object $mock |
||
49 | * @return ProxyInterface|ProxyTrait |
||
50 | */ |
||
51 | 17 | public function __moka_setMock($mock): self |
|
57 | |||
58 | /** |
||
59 | * @param MockingStrategyInterface $mockingStrategy |
||
60 | * @return ProxyInterface|ProxyTrait |
||
61 | */ |
||
62 | 15 | public function __moka_setMockingStrategy(MockingStrategyInterface $mockingStrategy): self |
|
68 | |||
69 | /** |
||
70 | * @param array $namesWithValues |
||
71 | * @return ProxyInterface |
||
72 | * |
||
73 | * @throws InvalidArgumentException |
||
74 | * @throws MockNotCreatedException |
||
75 | */ |
||
76 | 2 | public function stub(array $namesWithValues): ProxyInterface |
|
93 | |||
94 | /** |
||
95 | * @param string $name |
||
96 | * @param array $arguments |
||
97 | * @return mixed |
||
98 | * @throws InvalidArgumentException |
||
99 | * @throws MockNotCreatedException |
||
100 | */ |
||
101 | 6 | protected function doCall(string $name, array $arguments) |
|
111 | |||
112 | /** |
||
113 | * @param string $name |
||
114 | * @return mixed |
||
115 | * @throws InvalidArgumentException |
||
116 | * @throws MockNotCreatedException |
||
117 | */ |
||
118 | 4 | protected function doGet(string $name) |
|
130 | } |
||
131 |