| 1 | <?php |
||
| 15 | class Proxy |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $fqcn; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var MockingStrategyInterface |
||
| 24 | */ |
||
| 25 | private $mockingStrategy; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var object |
||
| 29 | */ |
||
| 30 | private $mock; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Proxy constructor. |
||
| 34 | * @param string $fqcn |
||
| 35 | * @param MockingStrategyInterface $mockingStrategy |
||
| 36 | */ |
||
| 37 | 13 | public function __construct(string $fqcn, MockingStrategyInterface $mockingStrategy) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $name |
||
| 45 | * @param array $arguments |
||
| 46 | * @return mixed |
||
| 47 | * |
||
| 48 | * @throws MockNotCreatedException |
||
| 49 | */ |
||
| 50 | 2 | public function __call(string $name, array $arguments) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @return object |
||
| 57 | * |
||
| 58 | * @throws MockNotCreatedException |
||
| 59 | */ |
||
| 60 | 6 | private function getMock() |
|
| 68 | |||
| 69 | /** |
||
| 70 | * @param array $methodsWithValues |
||
| 71 | * @return Proxy |
||
| 72 | * |
||
| 73 | * @throws InvalidArgumentException |
||
| 74 | * @throws MockNotCreatedException |
||
| 75 | */ |
||
| 76 | 2 | public function stub(array $methodsWithValues): self |
|
| 82 | |||
| 83 | /** |
||
| 84 | * @return object |
||
| 85 | * |
||
| 86 | * @throws MockNotServedException |
||
| 87 | */ |
||
| 88 | 3 | public function serve() |
|
| 96 | } |
||
| 97 |