mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Fix tests
This commit is contained in:
parent
5b7eed750f
commit
ca9fd29884
2 changed files with 3 additions and 7 deletions
|
@ -346,10 +346,7 @@ class OnboardingUrl {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function delete(): void {
|
public function delete(): void {
|
||||||
$cache_key = $this->cache_key();
|
$this->cache->delete( $this->cache_key() );
|
||||||
if ( $this->cache->has( $cache_key ) ) {
|
|
||||||
$this->cache->delete( $cache_key );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace WooCommerce\PayPalCommerce\Onboarding\Helper;
|
namespace WooCommerce\PayPalCommerce\Onboarding\Helper;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use WooCommerce\PayPalCommerce\TestCase;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use function Brain\Monkey\Functions\when;
|
use function Brain\Monkey\Functions\when;
|
||||||
|
@ -15,7 +15,7 @@ class OnboardingUrlTest extends TestCase
|
||||||
private $user_id = 123;
|
private $user_id = 123;
|
||||||
private $onboardingUrl;
|
private $onboardingUrl;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
@ -118,7 +118,6 @@ class OnboardingUrlTest extends TestCase
|
||||||
public function test_delete()
|
public function test_delete()
|
||||||
{
|
{
|
||||||
// Expectations
|
// Expectations
|
||||||
$this->cache->shouldReceive('has')->once();
|
|
||||||
$this->cache->shouldReceive('delete')->once();
|
$this->cache->shouldReceive('delete')->once();
|
||||||
|
|
||||||
$this->onboardingUrl->delete();
|
$this->onboardingUrl->delete();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue