Skip to content

Commit

Permalink
fix(wcs): remove subscriptions expiration feature flag (#3618)
Browse files Browse the repository at this point in the history
This removes the NEWSPACK_SUBSCRIPTIONS_EXPIRATION feature flag.
  • Loading branch information
chickenn00dle authored Dec 12, 2024
1 parent bf65278 commit 7c175d9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ public static function is_active() {
* True if:
* - WooCommerce Subscriptions is active and,
* - Reader Activation is enabled and,
* - The NEWSPACK_SUBSCRIPTIONS_EXPIRATION feature flag is defined and true.
*
* @return bool
*/
public static function is_enabled() {
if ( ! defined( 'NEWSPACK_SUBSCRIPTIONS_EXPIRATION' ) || ! NEWSPACK_SUBSCRIPTIONS_EXPIRATION ) {
return false;
}
$is_enabled = self::is_active() && Reader_Activation::is_enabled();
/**
* Filters whether subscriptions expiration is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
* @group WooCommerce_Subscriptions_Integration
*/
class Newspack_Test_Subscriptions_Meta extends WP_UnitTestCase {
/**
* Setup for the tests.
*/
public static function set_up_before_class() {
if ( ! defined( 'NEWSPACK_SUBSCRIPTIONS_EXPIRATION' ) ) {
define( 'NEWSPACK_SUBSCRIPTIONS_EXPIRATION', true );
}
}

/**
* Test Subscriptions_Meta::maybe_record_cancelled_subscription_meta.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
* @group WooCommerce_Subscriptions_Integration
*/
class Newspack_Test_WooCommerce_Subscriptions extends WP_UnitTestCase {
/**
* Setup for the tests.
*/
public static function set_up_before_class() {
if ( ! defined( 'NEWSPACK_SUBSCRIPTIONS_EXPIRATION' ) ) {
define( 'NEWSPACK_SUBSCRIPTIONS_EXPIRATION', true );
}
}

/**
* Test WooCommerce_Subscriptions::is_active.
*/
Expand All @@ -36,6 +27,6 @@ public function test_is_active() {
*/
public function test_is_enabled() {
$is_enabled = WooCommerce_Subscriptions::is_enabled();
$this->assertTrue( $is_enabled, 'WooCommerce Subscriptions integration should be enabled when Feature Flag is present.' );
$this->assertTrue( $is_enabled, 'WooCommerce Subscriptions integration should be enabled when RAS is enabled.' );
}
}

0 comments on commit 7c175d9

Please sign in to comment.