protected function setUp() { parent::setUp(); $this->beforeSpecify(function () { $this->checkOrderRequest = Mockery::mock('sergasd\\yandexkassa\\CheckOrderRequest'); $this->paymentAvisoRequest = Mockery::mock('sergasd\\yandexkassa\\PaymentAvisoRequest'); $this->requestFactory = Mockery::mock('sergasd\\yandexkassa\\RequestFactory'); $this->requestFactory->shouldReceive('createCheckOrderRequest')->andReturn($this->checkOrderRequest); $this->requestFactory->shouldReceive('createPaymentAvisoRequest')->andReturn($this->paymentAvisoRequest); $this->requestHandler = Mockery::mock('sergasd\\yandexkassa\\IRequestHandler'); $this->kassa = new YandexKassa($this->requestHandler, $this->requestFactory); $this->kassa->shopId = $this->shopId; $this->kassa->shopPassword = $this->shopPassword; }); }