/** * Setup */ protected function setUp() { $methods = ['id', 'merchantAccountId', 'orderId', 'paypalPaymentId', 'createdUsing', 'type', 'createdAt', 'amount', 'status', 'settlementBatchId', 'paymentInstrumentType']; $this->braintreeSearchAdapterMock = $this->getMockBuilder(BraintreeSearchAdapter::class)->setMethods($methods)->disableOriginalConstructor()->getMock(); foreach ($methods as $method) { $this->braintreeSearchAdapterMock->expects($this->once())->method($method)->willReturn(new BraintreeSearchNodeStub()); } $this->appliersPoolMock = $this->getMockBuilder(AppliersPool::class)->setMethods(['getApplier'])->disableOriginalConstructor()->getMock(); $this->applierMock = $this->getMockBuilder(ApplierInterface::class)->setMethods(['apply'])->disableOriginalConstructor()->getMock(); }
/** * Init fields map with Braintree filters * @return void */ private function initFieldsToFiltersMap() { $this->searchFieldsToFiltersMap = ['id' => $this->braintreeSearchAdapter->id(), 'merchantAccountId' => $this->braintreeSearchAdapter->merchantAccountId(), 'orderId' => $this->braintreeSearchAdapter->orderId(), 'paypalDetails_paymentId' => $this->braintreeSearchAdapter->paypalPaymentId(), 'createdUsing' => $this->braintreeSearchAdapter->createdUsing(), 'type' => $this->braintreeSearchAdapter->type(), 'createdAt' => $this->braintreeSearchAdapter->createdAt(), 'amount' => $this->braintreeSearchAdapter->amount(), 'status' => $this->braintreeSearchAdapter->status(), 'settlementBatchId' => $this->braintreeSearchAdapter->settlementBatchId(), 'paymentInstrumentType' => $this->braintreeSearchAdapter->paymentInstrumentType()]; }