mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Log endpoint errors
This commit is contained in:
parent
efb5ab3d14
commit
7ef5991cb8
9 changed files with 108 additions and 30 deletions
|
@ -8,6 +8,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Entity\PurchaseUnit;
|
|||
use WooCommerce\PayPalCommerce\ApiClient\Repository\CartRepository;
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use Mockery;
|
||||
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
||||
use function Brain\Monkey\Functions\expect;
|
||||
|
||||
class ChangeCartEndpointTest extends TestCase
|
||||
|
@ -68,7 +69,8 @@ class ChangeCartEndpointTest extends TestCase
|
|||
$shipping,
|
||||
$requestData,
|
||||
$cartRepository,
|
||||
$dataStore
|
||||
$dataStore,
|
||||
new NullLogger()
|
||||
);
|
||||
|
||||
expect('wp_send_json_success')
|
||||
|
@ -171,4 +173,4 @@ class ChangeCartEndpointTest extends TestCase
|
|||
|
||||
return $testData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ use WooCommerce\PayPalCommerce\Session\SessionHandler;
|
|||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
|
||||
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
||||
use function Brain\Monkey\Functions\expect;
|
||||
|
||||
class CreateOrderEndpointTest extends TestCase
|
||||
|
@ -160,7 +161,8 @@ class CreateOrderEndpointTest extends TestCase
|
|||
$payer_factory,
|
||||
$session_handler,
|
||||
$settings,
|
||||
$early_order_handler
|
||||
$early_order_handler,
|
||||
new NullLogger()
|
||||
);
|
||||
return array($payer_factory, $testee);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Entity\Token;
|
|||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use Mockery;
|
||||
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
use function Brain\Monkey\Functions\expect;
|
||||
|
||||
|
@ -22,7 +23,7 @@ class DataClientIdEndpointTest extends TestCase
|
|||
parent::setUp();
|
||||
$this->requestData = Mockery::mock(RequestData::class);
|
||||
$this->identityToken = Mockery::mock(IdentityToken::class);
|
||||
$this->sut = new DataClientIdEndpoint($this->requestData, $this->identityToken);
|
||||
$this->sut = new DataClientIdEndpoint($this->requestData, $this->identityToken, new NullLogger());
|
||||
}
|
||||
|
||||
public function testHandleRequestSuccess()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue