1 | <?php |
||
18 | class Proxy |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $fqcn; |
||
24 | |||
25 | /** |
||
26 | * @var StubSet |
||
27 | */ |
||
28 | private $stubs; |
||
29 | |||
30 | /** |
||
31 | * @var MockingStrategyInterface |
||
32 | */ |
||
33 | private $mockingStrategy; |
||
34 | |||
35 | /** |
||
36 | * @var object |
||
37 | */ |
||
38 | private $mock; |
||
39 | |||
40 | /** |
||
41 | * Proxy constructor. |
||
42 | * @param string $fqcn |
||
43 | * @param MockingStrategyInterface $mockingStrategy |
||
44 | */ |
||
45 | 10 | public function __construct(string $fqcn, MockingStrategyInterface $mockingStrategy) |
|
51 | |||
52 | /** |
||
53 | * @return void |
||
54 | */ |
||
55 | 10 | private function resetStubs() |
|
59 | |||
60 | /** |
||
61 | * @param array $methodsWithValues |
||
62 | * @return Proxy |
||
63 | * |
||
64 | * @throws InvalidArgumentException |
||
65 | */ |
||
66 | 2 | public function stub(array $methodsWithValues): self |
|
78 | |||
79 | /** |
||
80 | * @return void |
||
81 | * |
||
82 | * @throws InvalidArgumentException |
||
83 | */ |
||
84 | 3 | private function decorateMock() |
|
89 | |||
90 | /** |
||
91 | * @return object |
||
92 | * |
||
93 | * @throws MockNotServedException |
||
94 | */ |
||
95 | 3 | public function serve() |
|
107 | |||
108 | /** |
||
109 | * @return object |
||
110 | * |
||
111 | * @throws MockNotCreatedException |
||
112 | * @throws NotImplementedException |
||
113 | * @throws InvalidArgumentException |
||
114 | */ |
||
115 | 3 | private function buildMock() |
|
122 | } |
||
123 |