Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.' );
}
}
Loading