芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/myvyralapp.com/bck/vendor/srmklive/paypal/tests/Unit/Client/DisputesTest.php
mockListDisputesResponse(); $expectedEndpoint = 'https://api-m.sandbox.paypal.com/v1/customer/disputes/'; $expectedParams = [ 'headers' => [ 'Accept' => 'application/json', 'Accept-Language' => 'en_US', 'Authorization' => 'Bearer some-token', ], ]; $mockHttpClient = $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint, $expectedParams, 'get'); $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } /** @test */ public function it_can_partially_update_a_dispute() { $expectedResponse = ''; $expectedEndpoint = 'https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-D-27803'; $expectedParams = [ 'headers' => [ 'Accept' => 'application/json', 'Accept-Language' => 'en_US', 'Authorization' => 'Bearer some-token', ], 'json' => $this->updateDisputeParams(), ]; $mockHttpClient = $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint, $expectedParams, 'patch'); $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } /** @test */ public function it_can_get_details_for_a_dispute() { $expectedResponse = $this->mockGetDisputesResponse(); $expectedEndpoint = 'https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-D-4012'; $expectedParams = [ 'headers' => [ 'Accept' => 'application/json', 'Accept-Language' => 'en_US', 'Authorization' => 'Bearer some-token', ], ]; $mockHttpClient = $this->mock_http_request(Utils::jsonEncode($expectedResponse), $expectedEndpoint, $expectedParams, 'get'); $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } }