mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
♻️ Update tests to use the new Enum
This commit is contained in:
parent
ba122714d8
commit
ed3c6799d0
2 changed files with 7 additions and 6 deletions
|
@ -5,7 +5,7 @@ namespace WooCommerce\PayPalCommerce\ApiClient\Helper;
|
|||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
use WooCommerce\PayPalCommerce\Settings\Service\BrandedExperience\ActivationDetector;
|
||||
use WooCommerce\PayPalCommerce\Settings\Enum\InstallationPathEnum;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
use function Brain\Monkey\Functions\expect;
|
||||
use function Brain\Monkey\setUp;
|
||||
|
@ -29,8 +29,8 @@ class PartnerAttributionTest extends TestCase {
|
|||
* @var array
|
||||
*/
|
||||
private array $bn_codes = array(
|
||||
ActivationDetector::CORE_PROFILER => 'WooPPCP_Ecom_PS_CoreProfiler',
|
||||
ActivationDetector::PAYMENT_SETTINGS => 'WooPPCP_Ecom_PS_CoreProfiler',
|
||||
InstallationPathEnum::CORE_PROFILER => 'WooPPCP_Ecom_PS_CoreProfiler',
|
||||
InstallationPathEnum::PAYMENT_SETTINGS => 'WooPPCP_Ecom_PS_CoreProfiler',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ declare( strict_types=1 );
|
|||
namespace PHPUnit\Settings\Service\BrandedExperience;
|
||||
|
||||
use WooCommerce\PayPalCommerce\Settings\Service\BrandedExperience\ActivationDetector;
|
||||
use WooCommerce\PayPalCommerce\Settings\Enum\InstallationPathEnum;
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use function Brain\Monkey\Functions\expect;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
|
@ -14,7 +15,7 @@ class ActivationDetectorTest extends TestCase {
|
|||
when( 'get_option' )->justReturn( [] );
|
||||
$detector = new ActivationDetector();
|
||||
|
||||
$this->assertEquals( ActivationDetector::DIRECT, $detector->detect_activation_path() );
|
||||
$this->assertEquals( InstallationPathEnum::DIRECT, $detector->detect_activation_path() );
|
||||
}
|
||||
|
||||
public function test_returns_core_profiler_if_attached_via_core_profiler() {
|
||||
|
@ -28,7 +29,7 @@ class ActivationDetectorTest extends TestCase {
|
|||
|
||||
$detector = new ActivationDetector();
|
||||
|
||||
$this->assertEquals( ActivationDetector::CORE_PROFILER, $detector->detect_activation_path() );
|
||||
$this->assertEquals( InstallationPathEnum::CORE_PROFILER, $detector->detect_activation_path() );
|
||||
}
|
||||
|
||||
public function test_returns_payment_settings_if_attached_via_payments_settings_page() {
|
||||
|
@ -46,6 +47,6 @@ class ActivationDetectorTest extends TestCase {
|
|||
|
||||
$detector = new ActivationDetector();
|
||||
|
||||
$this->assertEquals( ActivationDetector::PAYMENT_SETTINGS, $detector->detect_activation_path() );
|
||||
$this->assertEquals( InstallationPathEnum::PAYMENT_SETTINGS, $detector->detect_activation_path() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue