Skip to content

Commit

Permalink
chore: remove methods deprecated in 5.6.0 (#9567)
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso authored Oct 18, 2024
1 parent 3326a6d commit a35b00c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 63 deletions.
4 changes: 4 additions & 0 deletions changelog/chore-remove-woopayments-dev-test-mode-calls
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

chore: remove deprecated is_in_dev_mode() and is_in_test_mode() methods
28 changes: 0 additions & 28 deletions includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4507,34 +4507,6 @@ public function find_duplicates() {
return $this->duplicate_payment_methods_detection_service->find_duplicates();
}

// Start: Deprecated functions.

/**
* Check the defined constant to determine the current plugin mode.
*
* @deprecated 5.6.0
*
* @return bool
*/
public function is_in_dev_mode() {
wc_deprecated_function( __FUNCTION__, '5.6.0', 'WC_Payments::mode()->is_dev()' );
return WC_Payments::mode()->is_dev();
}

/**
* Returns whether test_mode or dev_mode is active for the gateway
*
* @deprecated 5.6.0
*
* @return boolean Test mode enabled if true, disabled if false
*/
public function is_in_test_mode() {
wc_deprecated_function( __FUNCTION__, '5.6.0', 'WC_Payments::mode()->is_test()' );
return WC_Payments::mode()->is_test();
}

// End: Deprecated functions.

/**
* Determine whether redirection is needed for the non-card UPE payment method.
*
Expand Down
35 changes: 0 additions & 35 deletions tests/unit/test-class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -3444,41 +3444,6 @@ public function is_woopay_falsy_value_provider() {
];
}

/**
* @expectedDeprecated is_in_dev_mode
*/
public function test_is_in_dev_mode() {
$mode = WC_Payments::mode();

$mode->dev();
$this->assertTrue( $this->card_gateway->is_in_dev_mode() );

$mode->live_mode_onboarding();
$this->assertFalse( $this->card_gateway->is_in_dev_mode() );

$mode->live();
$this->assertFalse( $this->card_gateway->is_in_dev_mode() );
}

/**
* @expectedDeprecated is_in_test_mode
*/
public function test_is_in_test_mode() {
$mode = WC_Payments::mode();

$mode->dev();
$this->assertTrue( $this->card_gateway->is_in_test_mode() );

$mode->test_mode_onboarding();
$this->assertTrue( $this->card_gateway->is_in_test_mode() );

$mode->test();
$this->assertTrue( $this->card_gateway->is_in_test_mode() );

$mode->live();
$this->assertFalse( $this->card_gateway->is_in_test_mode() );
}

/**
* Create a partial mock for WC_Payment_Gateway_WCPay class.
*
Expand Down

0 comments on commit a35b00c

Please sign in to comment.