Remove deprecated RemoteInboxNotification classes (#51250)

* Remove deprecated RemoteInboxNotification classes

* Derecate RIN interfaces

* Move RIN tests to remote specs folder

* Add changelog

* Update changelog

* Fix lint

* Fix lint

* Fix tests
This commit is contained in:
Chi-Hsuan Huang 2024-09-13 08:31:59 +08:00 committed by GitHub
parent cc781792fd
commit 45fc403f6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
76 changed files with 173 additions and 1673 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Remove deprecated RemoteInboxNotification classes

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that performs a comparison operation against the base
* location - country.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
defined( 'ABSPATH' ) || exit;
/**
* Rule processor that performs a comparison operation against the base
* location - country.
*
* @deprecated 8.8.0
*/
class BaseLocationCountryRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\BaseLocationCountryRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that performs a comparison operation against the base
* location - state.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
defined( 'ABSPATH' ) || exit;
/**
* Rule processor that performs a comparison operation against the base
* location - state.
*
* @deprecated 8.8.0
*/
class BaseLocationStateRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\BaseLocationStateRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Compare two operands using the specified operation.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Compare two operands using the specified operation.
*
* @deprecated 8.8.0
*/
class ComparisonOperation extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\ComparisonOperation';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Evaluates the spec and returns a status.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Evaluates the spec and returns a status.
*
* @deprecated 8.8.0
*/
class EvaluateAndGetStatus extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\EvaluateAndGetStatus';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,27 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Class EvaluationLogger
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications
*
* @deprecated 8.8.0
*/
class EvaluationLogger extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\EvaluationLogger';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor that fails.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that fails.
*
* @deprecated 8.8.0
*/
class FailRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\FailRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Gets the processor for the specified rule type.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Class encapsulating getting the processor for a given rule type.
*
* @deprecated 8.8.0
*/
class GetRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\GetRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,35 +0,0 @@
<?php
/**
* Rule processor that passes (or fails) when the site is on the eCommerce
* plan.
*
* @package WooCommerce\Admin\Classes
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that passes (or fails) when the site is on the eCommerce
* plan.
*
* @deprecated 8.8.0
*/
class IsEcommerceRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\IsEcommerceRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,34 +0,0 @@
<?php
/**
* Rule processor that passes (or fails) when the site is on a Woo Express plan.
*
* @package WooCommerce\Admin\Classes
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that passes (or fails) when the site is on a Woo Express plan.
* You may optionally pass a plan name to target a specific Woo Express plan.
*
* @deprecated 8.8.0
*/
class IsWooExpressRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\IsWooExpressRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor that negates the rules in the rule's operand.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that negates the rules in the rule's operand.
*
* @deprecated 8.8.0
*/
class NotRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\NotRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that compares against the status of another note. For
* example, this could be used to conditionally create a note only if another
* note has not been actioned.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that compares against the status of another note.
*
* @deprecated 8.8.0
*/
class NoteStatusRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\NoteStatusRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that performs a comparison operation against a value in the
* onboarding profile.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that performs a comparison operation against a value in the
* onboarding profile.
*
* @deprecated 8.8.0
*/
class OnboardingProfileRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OnboardingProfileRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor that performs a comparison operation against an option value.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that performs a comparison operation against an option value.
*
* @deprecated 8.8.0
*/
class OptionRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OptionRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that performs an OR operation on the rule's left and right
* operands.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that performs an OR operation on the rule's left and right
* operands.
*
* @deprecated 8.8.0
*/
class OrRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OrRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor for publishing based on the number of orders.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for publishing based on the number of orders.
*
* @deprecated 8.8.0
*/
class OrderCountRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OrderCountRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Provider for order-related queries and operations.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Provider for order-related queries and operations.
*
* @deprecated 8.8.0
*/
class OrdersProvider extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OrdersProvider';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,32 +0,0 @@
<?php
/**
* Rule processor that passes. This is required because an empty set of rules
* (or predicate) evaluates to false.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that passes.
*
* @deprecated 8.8.0
*/
class PassRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PassRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor for sending when the provided plugin is activated and
* matches the specified version.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for sending when the provided plugin is activated and
* matches the specified version.
*
* @deprecated 8.8.0
*/
class PluginVersionRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PluginVersionRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor for sending when the provided plugins are activated.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for sending when the provided plugins are activated.
*
* @deprecated 8.8.0
*/
class PluginsActivatedRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PluginsActivatedRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that performs a comparison operation against the number of
* products.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that performs a comparison operation against the number of
* products.
*
* @deprecated 8.8.0
*/
class ProductCountRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\ProductCountRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor for sending after a specified date/time.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for sending after a specified date/time.
*
* @deprecated 8.8.0
*/
class PublishAfterTimeRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PublishAfterTimeRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor for sending before a specified date/time.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for sending before a specified date/time.
*
* @deprecated 8.8.0
*/
class PublishBeforeTimeRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PublishBeforeTimeRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Evaluate the given rules as an AND operation - return false early if a
* rule evaluates to false.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Evaluate the given rules as an AND operation - return false early if a
* rule evaluates to false.
*
* @deprecated 8.8.0
*/
class RuleEvaluator extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\RuleEvaluator';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,6 +1,8 @@
<?php
/**
* Interface for a rule processor.
*
* @deprecated 9.4.0 Use \Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\RuleProcessorInterface instead.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
@ -9,6 +11,8 @@ defined( 'ABSPATH' ) || exit;
/**
* Rule processor interface
*
* @deprecated 9.4.0 Use \Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\RuleProcessorInterface instead.
*/
interface RuleProcessorInterface {
/**

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor that performs a comparison operation against a value in the
* stored state object.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that performs a comparison operation against a value in the
* stored state object.
*
* @deprecated 8.8.0
*/
class StoredStateRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\StoredStateRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Handles stored state setup for products.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Handles stored state setup for products.
*
* @deprecated 8.8.0
*/
class StoredStateSetupForProducts extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\StoredStateSetupForProducts';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor that passes when a store's payments volume exceeds a provided amount.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor that passes when a store's payments volume exceeds a provided amount.
*
* @deprecated 8.8.0
*/
class TotalPaymentsVolumeProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\TotalPaymentsVolumeProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,4 +1,9 @@
<?php
/**
* Interface for a transformer.
*
* @deprecated 9.4.0 Use \Automattic\WooCommerce\Admin\RemoteSpecs\Transformers\TransformerInterface instead.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
@ -10,6 +15,8 @@ use stdClass;
* Interface TransformerInterface
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications
*
* @deprecated 9.4.0 Use \Automattic\WooCommerce\Admin\RemoteSpecs\Transformers\TransformerInterface instead.
*/
interface TransformerInterface {
/**

View File

@ -1,30 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* A simple service class for the Transformer classes.
*
* Class TransformerService
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications
*
* @deprecated 8.8.0
*/
class TransformerService extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\TransformerService';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Search array value by one of its key.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class ArrayColumn extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Flatten nested array.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class ArrayFlatten extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Search array value by one of its key.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class ArrayKeys extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Searches a given a given value in the array.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class ArraySearch extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Search array value by one of its key.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class ArrayValues extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Count elements in Array or Countable object.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class Count extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Find an array value by dot notation.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class DotNotation extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,28 +0,0 @@
<?php
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Prepare site URL for comparison.
*
* @package Automattic\WooCommerce\Admin\RemoteInboxNotifications\Transformers
*
* @deprecated 8.8.0
*/
class PrepareUrl extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,402 +0,0 @@
# Option Transformer
An option transformer is a class that transforms the given option value into a different value for the comparison operation.
Transformers run in the order in which they are defined, and each transformer passes down the value it transformed to the next transformer for consumption.
**Definition example**: transformers are always used with `option` rule.
```
{
"slug": "test-note",
...
],
"rules": [
{
"type": "option",
"transformers": [
{
"use": "dot_notation",
"arguments": {
"path": "industry"
}
},
{
"use": "array_column",
"arguments": {
"key": "slug"
}
}
],
"option_name": "woocommerce_onboarding_profile",
"operation": "!=",
"value": "fashion-apparel-accessories",
"default": []
}
]
}
```
## array_column
PHP's built-in `array_column` to select values from a single column. For more information about how array_column works, please see PHP's [official documentation](https://www.php.net/manual/en/function.array-column.php).
#### Arguments:
| name | description |
| ---- | -------------- |
| key | array key name |
#### Definition:
```php
"transformers": [
{
"use": "array_column",
"arguments": {
"key": "industry"
}
}
],
```
#### Example:
Given the following data
```php
array(
array("industry" => "media" ),
array("industry" => "software" )
);
```
Use `array_column` to extract `array("media", "software")` then choose the first element with `dot_notation`.
```php
"transformers": [
{
"use": "array_column",
"arguments": {
"key": "industry"
}
},
{
"use": "dot_notation",
"arguments": {
"key": "0"
}
}
],
```
**Output**: "media"
## array_flatten
Flattens a nested array.
#### Arguments: N/A
#### Definition:
```php
"transformers": [
{
"use": "array_flatten"
}
],
```
#### Example:
Given the following data
```php
array(
array(
'member1',
),
array(
'member2',
),
array(
'member3',
),
);
```
Use `array_flatten` to extract `array("member1", "member2", "member3")` then use `array_search` to make sure it has `member2`
```php
"transformers": [
{
"use": "array_flatten",
},
{
"use": "array_search",
"arguments": {
"key": "member2"
}
}
],
```
**Output**: true
## array_keys
PHP's built-in `array_keys` to return keys from an array. For more information about how `array_keys` works, please see PHPs [official documentation](https://www.php.net/manual/en/function.array-column.php).
#### Arguments: N/A
####Definition:
```php
"transformers": [
{
"use": "array_keys"
}
],
```
#### Example:
Given the following data
```php
array(
"name" => "tester",
"address" => "test",
"supports_version_2" => true
)
```
Use `array_keys` to extract `array("name", "address", "supports_version_2")` and then use `array_search` to make sure it has `supports_version_2`
```php
"transformers": [
{
"use": "array_keys",
},
{
"use": "array_search",
"arguments": {
"key": "member2"
}
}
],
```
**Output**: true
## array_search
PHP's built-in `array_search` to search a value in an array. For more information about how `array_search` works, please see PHPs [official documentation](https://www.php.net/manual/en/function.array-search.php).
#### Arguments:
|name|description|
|----|---------|
| value | a value to search in the given array |
#### Definition:
```php
"transformers": [
{
"use": "array_search",
"arguments": {
"value": "test"
}
}
],
```
#### Examples
See examples from [array_flatten](#array_flatten) and [array_keys](#array_keys)
## array_values
PHP's built-in array_values to return values from an array. For more information about how `array_values` works, please see PHPs [official documentation](https://www.php.net/manual/en/function.array-values).
#### Arguments: N/A
#### Definition:
```php
"transformers": [
{
"use": "array_values"
}
],
```
#### Example:
Given the following data
```php
array (
"size" => "x-large"
)
```
Use `array_values` to extract `array("x-large")`
```php
"transformers": [
{
"use": "array_values",
}
],
```
**Output:** "x-large"
## dot_notation
Uses dot notation to select a value in an array. Dot notation lets you access an array as if it is an object.
#### Arguments: N/A
#### Definition:
```php
"transformers": [
{
"use": "dot_notation",
"arguments": {
"path": "name"
}
}
],
```
#### Example:
Given the following data
```php
array(
'name' => 'john',
'members' => ['member1', 'member2']
);
```
Select `name` field.
```php
"transformers": [
{
"use": "dot_notation",
"arguments": {
"path": "name"
}
}
],
```
**Output:** "john"
Select `member2`. You can access array items with an index.
```php
"transformers": [
{
"use": "dot_notation",
"arguments": {
"path": "members.1"
}
}
],
```
**Output:**: "member2"
## count
PHP's built-in count to return the number of values from a countable, such as an array.
#### Arguments: N/A
#### Definition:
```php
"transformers": [
{
"use": "count"
}
],
```
#### Example:
Given the following list of usernames
```php
array(
"username1",
"username2",
"username3"
)
```
Let's count # of users with `count`
```php
"transformers": [
{
"use": "count",
}
],
```
**Output:** 3
## prepare_url
This prepares the site URL by removing the protocol and the last slash.
#### Arguments: N/A
####Definition:
```php
"transformers": [
{
"use": "prepare_url"
}
],
```
#### Example:
Given the following data
```php
$siteurl = "https://mysite.com/"
```
Removes the protocol and the last slash.
```php
"transformers": [
{
"use": "prepare_url",
}
],
```
**Output:** "mysite.com"

View File

@ -1,31 +0,0 @@
<?php
/**
* WCAdmin active for provider.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* WCAdminActiveForProvider class
*
* @deprecated 8.8.0
*/
class WCAdminActiveForProvider extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\WCAdminActiveForProvider';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,33 +0,0 @@
<?php
/**
* Rule processor for publishing if wc-admin has been active for at least the
* given number of seconds.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for publishing if wc-admin has been active for at least the
* given number of seconds.
*
* @deprecated 8.8.0
*/
class WCAdminActiveForRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\WCAdminActiveForRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -1,31 +0,0 @@
<?php
/**
* Rule processor for sending when WooCommerce Admin has been updated.
*/
namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
/**
* Rule processor for sending when WooCommerce Admin has been updated.
*
* @deprecated 8.8.0
*/
class WooCommerceAdminUpdatedRuleProcessor extends DeprecatedClassFacade {
/**
* The name of the non-deprecated class that this facade covers.
*
* @var string
*/
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\WooCommerceAdminUpdatedRuleProcessor';
/**
* The version that this class was deprecated in.
*
* @var string
*/
protected static $deprecated_in_version = '8.8.0';
}

View File

@ -2,16 +2,18 @@
/**
* Base Location country rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\BaseLocationCountryRuleProcessor;
use Automattic\WooCommerce\Internal\Admin\Onboarding\OnboardingProfile;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_BaseLocationCountryRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_BaseLocationCountryRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_BaseLocationCountryRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_BaseLocationCountryRuleProcessor extends WC_Unit_Test_Case {
/**
* Get the publish_before rule.
*

View File

@ -2,16 +2,18 @@
/**
* Base Location state rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\BaseLocationStateRuleProcessor;
use Automattic\WooCommerce\Internal\Admin\Onboarding\OnboardingProfile;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_BaseLocationStateRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_BaseLocationStateRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_BaseLocationStateRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_BaseLocationStateRuleProcessor extends WC_Unit_Test_Case {
/**
* Get the base_location_state rule.

View File

@ -5,12 +5,14 @@
* @package WooCommerce\Admin\Tests\RemoteInboxNotification
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\ComparisonOperation;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Comparison_Operation
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_Comparison_Operation
*/
class WC_Admin_Tests_RemoteInboxNotifications_Comparison_Operation extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_Comparison_Operation extends WC_Unit_Test_Case {
/**
* @var ComparisonOperation $operation
*/
@ -36,7 +38,6 @@ class WC_Admin_Tests_RemoteInboxNotifications_Comparison_Operation extends WC_Un
$this->assertFalse( $this->operation->compare( 11, array( 1, 10 ), 'range' ) );
$this->assertFalse( $this->operation->compare( 11, array( 1, 10, 2 ), 'range' ) );
$this->assertFalse( $this->operation->compare( 11, 'string', 'range' ) );
}
/**

View File

@ -2,15 +2,17 @@
/**
* Evaluate and get status tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\EvaluateAndGetStatus;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_EvaluateAndGetStatus
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_EvaluateAndGetStatus
*/
class WC_Admin_Tests_RemoteInboxNotifications_EvaluateAndGetStatus extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_EvaluateAndGetStatus extends WC_Unit_Test_Case {
/**
* Build up a spec given the supplied parameters.
*

View File

@ -2,9 +2,11 @@
/**
* FailingRuleEvaluator
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
/**
* class FailingRuleEvaluator
*/
@ -16,7 +18,7 @@ class FailingRuleEvaluator {
*
* @return bool The evaluated result.
*/
public function evaluate( $rules ) {
public function evaluate( $rules ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
return false;
}
}

View File

@ -2,15 +2,17 @@
/**
* Get rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\GetRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_GetRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_GetRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_GetRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_GetRuleProcessor extends WC_Unit_Test_Case {
/**
* Tests that an unknown rule processor returns a FailRuleProcessor
*

View File

@ -2,15 +2,17 @@
/**
* Is WooExpress rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\IsWooExpressRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_IsWooExpressRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_IsWooExpressRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_IsWooExpressRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_IsWooExpressRuleProcessor extends WC_Unit_Test_Case {
/**
* Set Up Before Class.
*/

View File

@ -2,9 +2,11 @@
/**
* Mock DateTime Provider.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\DateTimeProvider\DateTimeProviderInterface;
/**
@ -29,4 +31,3 @@ class MockDateTimeProvider implements DateTimeProviderInterface {
return $this->now;
}
}

View File

@ -2,9 +2,11 @@
/**
* MockGetRuleProcessor.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PublishAfterTimeRuleProcessor;
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\FailRuleProcessor;
@ -29,4 +31,3 @@ class MockGetRuleProcessor {
return new FailRuleProcessor();
}
}

View File

@ -2,9 +2,11 @@
/**
* Mock plugins Provider.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\PluginsProvider\PluginsProviderInterface;
/**

View File

@ -2,9 +2,11 @@
/**
* Mock product query.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
/**
* Mock product query.
*/
@ -29,4 +31,3 @@ class MockProductQuery {
);
}
}

View File

@ -2,9 +2,11 @@
/**
* Mock WCAdminActiveForProvider
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
/**
* Mock WCAdminActiveForProvider
*/

View File

@ -2,16 +2,18 @@
/**
* Not rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\NotRuleProcessor;
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\RuleEvaluator;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_NotRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_NotRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_NotRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_NotRuleProcessor extends WC_Unit_Test_Case {
/**
* An empty operand evaluates to false, so negating that should
* evaluate to true.

View File

@ -2,16 +2,18 @@
/**
* Onboarding profile rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OnboardingProfileRuleProcessor;
use Automattic\WooCommerce\Internal\Admin\Onboarding\OnboardingProfile;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_OnboardingProfileRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_OnboardingProfileRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_OnboardingProfileRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_OnboardingProfileRuleProcessor extends WC_Unit_Test_Case {
/**
* Get the publish_before rule.
*

View File

@ -2,15 +2,17 @@
/**
* Option rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OptionRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_OptionRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_OptionRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_OptionRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_OptionRuleProcessor extends WC_Unit_Test_Case {
/**
* No default option resolves to false.
*

View File

@ -2,16 +2,18 @@
/**
* Or rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\OrRuleProcessor;
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\RuleEvaluator;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_OrRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_OrRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_OrRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_OrRuleProcessor extends WC_Unit_Test_Case {
/**
* Both operands evaluating to false and ORed together evaluates to false.
*

View File

@ -2,9 +2,11 @@
/**
* PassingRuleEvaluator
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
/**
* class PassingRuleEvaluator
*/
@ -16,7 +18,7 @@ class PassingRuleEvaluator {
*
* @return bool The evaluated result.
*/
public function evaluate( $rules ) {
public function evaluate( $rules ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
return true;
}
}

View File

@ -2,15 +2,17 @@
/**
* Plugin version rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PluginVersionRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_PluginVersionRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PluginVersionRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_PluginVersionRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PluginVersionRuleProcessor extends WC_Unit_Test_Case {
/**
* Test that the processor does not pass if the plugin is not activated.
*

View File

@ -2,16 +2,18 @@
/**
* Plugins activated rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PluginsActivatedRuleProcessor;
use Automattic\WooCommerce\Admin\PluginsProvider\PluginsProviderInterface;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_PluginsActivatedRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PluginsActivatedRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_PluginsActivatedRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PluginsActivatedRuleProcessor extends WC_Unit_Test_Case {
/**
* Tests that the processor does not pass a plugins_activated rule with
* no plugins to verify.

View File

@ -2,15 +2,17 @@
/**
* Product count rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\ProductCountRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_ProductCountRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_ProductCountRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_ProductCountRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_ProductCountRuleProcessor extends WC_Unit_Test_Case {
/**
* Get a product_count rule that passes when the product count is > 5.
*

View File

@ -2,16 +2,18 @@
/**
* Publish after time rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PublishAfterTimeRuleProcessor;
use Automattic\WooCommerce\Admin\DateTimeProvider\DateTimeProviderInterface;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_PublishAfterTimeRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PublishAfterTimeRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_PublishAfterTimeRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PublishAfterTimeRuleProcessor extends WC_Unit_Test_Case {
/**
* Get the publish_after rule.
*

View File

@ -2,16 +2,18 @@
/**
* Publish before time rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\PublishBeforeTimeRuleProcessor;
use Automattic\WooCommerce\Admin\DateTimeProvider\DateTimeProviderInterface;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_PublishBeforeTimeRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PublishBeforeTimeRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_PublishBeforeTimeRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_PublishBeforeTimeRuleProcessor extends WC_Unit_Test_Case {
/**
* Get the publish_before rule.
*

View File

@ -2,15 +2,17 @@
/**
* Stored state rule processor tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\StoredStateRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_StoredStateRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_StoredStateRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_StoredStateRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_StoredStateRuleProcessor extends WC_Unit_Test_Case {
/**
* Empty $stored_state evaluates to false.
*

View File

@ -5,13 +5,15 @@
* @package WooCommerce\Admin\Tests\RemoteInboxNotification
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\TotalPaymentsVolumeProcessor;
use Automattic\WooCommerce\Admin\API\Reports\Revenue\Query as RevenueQuery;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_TotalPaymentsVolumeProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_TotalPaymentsVolumeProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_TotalPaymentsVolumeProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_TotalPaymentsVolumeProcessor extends WC_Unit_Test_Case {
/**
* Greater than 1000 total payments volume evaluates to false.

View File

@ -2,16 +2,18 @@
/**
* TransformerService tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayKeys;
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\TransformerService;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_TransformerService
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_TransformerService
*/
class WC_Admin_Tests_RemoteInboxNotifications_TransformerService extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_TransformerService extends WC_Unit_Test_Case {
/**
* Test it creates a transformer with snake case 'use' value
*/

View File

@ -2,23 +2,25 @@
/**
* ArrayColumn tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayColumn;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayColumn
* class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayColumn
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayColumn extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayColumn extends WC_Unit_Test_Case {
/**
* Test validate method returns false when 'key' argument is missing
*/
public function test_validate_returns_false_when_key_argument_is_missing() {
$array_column = new ArrayColumn();
$result = $array_column->validate( (object) array() );
$this->assertFalse( false, $result );
$this->assertFalse( $result );
}
/**
@ -31,14 +33,14 @@ class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayColumn extends W
'key' => true,
)
);
$this->assertFalse( false, $result );
$this->assertFalse( $result );
$result = $array_column->validate(
(object) array(
'key' => array(),
)
);
$this->assertFalse( false, $result );
$this->assertFalse( $result );
}
/**

View File

@ -2,9 +2,11 @@
/**
* ArrayKeys tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayFlatten;
/**

View File

@ -2,15 +2,17 @@
/**
* ArrayKeys tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayKeys;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayKeys
* class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayKeys
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayKeys extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayKeys extends WC_Unit_Test_Case {
/**
* Test it returns default value when value is not an array
*/

View File

@ -2,22 +2,24 @@
/**
* ArraySearch tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArraySearch;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArraySearch
* class WC_Admin_Tests_RemoteSpecs_Transformers_ArraySearch
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArraySearch extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_ArraySearch extends WC_Unit_Test_Case {
/**
* Test validate method returns false when 'value' argument is missing
*/
public function test_validate_returns_false_when_value_argument_is_missing() {
$array_column = new ArraySearch();
$result = $array_column->validate( (object) array() );
$this->assertFalse( false, $result );
$this->assertFalse( $result );
}
/**

View File

@ -2,15 +2,17 @@
/**
* ArrayValues tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\ArrayValues;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayValues
* class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayValues
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayValues extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayValues extends WC_Unit_Test_Case {
/**
* Test it returns default value when value is not an array
*/

View File

@ -2,15 +2,17 @@
/**
* ArrayValues tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\Count;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayValues
* class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayValues
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayCount extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_ArrayCount extends WC_Unit_Test_Case {
/**
* Test it returns default value when value is not an array.
*/

View File

@ -2,16 +2,18 @@
/**
* DotNotation tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\DotNotation;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_DotNotation
* class WC_Admin_Tests_RemoteSpecs_Transformers_DotNotation
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_DotNotation extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_DotNotation extends WC_Unit_Test_Case {
/**
* Test validate method returns false when 'path' argument is missing
@ -19,7 +21,7 @@ class WC_Admin_Tests_RemoteInboxNotifications_Transformers_DotNotation extends W
public function test_validate_returns_false_when_path_argument_is_missing() {
$array_column = new DotNotation();
$result = $array_column->validate( (object) array() );
$this->assertFalse( false, $result );
$this->assertFalse( $result );
}
/**

View File

@ -2,15 +2,17 @@
/**
* PrepareUrl tests.
*
* @package WooCommerce\Admin\Tests\RemoteInboxNotifications
* @package WooCommerce\Admin\Tests\RemoteSpecs
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\Transformers\PrepareUrl;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_Transformers_PrepareUrl
* class WC_Admin_Tests_RemoteSpecs_Transformers_PrepareUrl
*/
class WC_Admin_Tests_RemoteInboxNotifications_Transformers_PrepareUrl extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_Transformers_PrepareUrl extends WC_Unit_Test_Case {
/**
* Test it returns default value when url is not string.
*/

View File

@ -5,12 +5,14 @@
* @package WooCommerce\Admin\Tests\RemoteInboxNotification
*/
declare( strict_types = 1 );
use Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors\WCAdminActiveForRuleProcessor;
/**
* class WC_Admin_Tests_RemoteInboxNotifications_WCAdminActiveForRuleProcessor
* class WC_Admin_Tests_RemoteSpecs_RuleProcessors_WCAdminActiveForRuleProcessor
*/
class WC_Admin_Tests_RemoteInboxNotifications_WCAdminActiveForRuleProcessor extends WC_Unit_Test_Case {
class WC_Admin_Tests_RemoteSpecs_RuleProcessors_WCAdminActiveForRuleProcessor extends WC_Unit_Test_Case {
/**
* Greater than 7 days evaluates to true
*