![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/srmklive/paypal/tests/Unit/Adapter/ |
<?php namespace Srmklive\PayPal\Tests\Unit\Adapter; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; use Srmklive\PayPal\Tests\MockResponsePayloads; class InvoicesSearchTest extends TestCase { use MockClientClasses; use MockRequestPayloads; use MockResponsePayloads; /** @test */ public function it_can_search_invoices() { $expectedResponse = $this->mockSearchInvoicesResponse(); $expectedMethod = 'searchInvoices'; $mockClient = $this->mock_client($expectedResponse, $expectedMethod, true); $mockClient->setApiCredentials($this->getMockCredentials()); $mockClient->getAccessToken(); $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}(1, 1, true)); } /** @test */ public function it_can_search_invoices_with_custom_filters() { $expectedResponse = $this->mockSearchInvoicesResponse(); $expectedMethod = 'searchInvoices'; $mockClient = $this->mock_client($expectedResponse, $expectedMethod, true); $mockClient->setApiCredentials($this->getMockCredentials()); $mockClient->getAccessToken(); $this->assertEquals($expectedResponse, $mockClient->addInvoiceFilterByRecipientEmail('bill-me@example.com') ->addInvoiceFilterByCurrencyCode('USD') ->addInvoiceFilterByAmountRange(30, 50) ->{$expectedMethod}(1, 1, true)); } }