diff --git a/plugins/woocommerce/changelog/update-remove-deprecated-rin-classes b/plugins/woocommerce/changelog/update-remove-deprecated-rin-classes new file mode 100644 index 00000000000..2fc99a0873a --- /dev/null +++ b/plugins/woocommerce/changelog/update-remove-deprecated-rin-classes @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Remove deprecated RemoteInboxNotification classes diff --git a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/BaseLocationCountryRuleProcessor.php b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/BaseLocationCountryRuleProcessor.php deleted file mode 100644 index 3854f372b83..00000000000 --- a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/BaseLocationCountryRuleProcessor.php +++ /dev/null @@ -1,33 +0,0 @@ - "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 PHP’s [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 PHP’s [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 PHP’s [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" diff --git a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/WCAdminActiveForProvider.php b/plugins/woocommerce/src/Admin/RemoteInboxNotifications/WCAdminActiveForProvider.php deleted file mode 100644 index 21d53b4c0c1..00000000000 --- a/plugins/woocommerce/src/Admin/RemoteInboxNotifications/WCAdminActiveForProvider.php +++ /dev/null @@ -1,31 +0,0 @@ -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' ) ); - } /** diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/evaluate-and-get-status.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/evaluate-and-get-status.php similarity index 95% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/evaluate-and-get-status.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/evaluate-and-get-status.php index 7de3b0c6251..7ec67d2f995 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/evaluate-and-get-status.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/evaluate-and-get-status.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/failing-rule-evaluator.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/failing-rule-evaluator.php similarity index 58% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/failing-rule-evaluator.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/failing-rule-evaluator.php index 8d856895e5b..b4c79cffb31 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/failing-rule-evaluator.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/failing-rule-evaluator.php @@ -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; } } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/get-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/get-rule-processor.php similarity index 70% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/get-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/get-rule-processor.php index b5eee559d84..fb2721229eb 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/get-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/get-rule-processor.php @@ -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 * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/is-woo-express-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/is-woo-express-rule-processor.php similarity index 91% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/is-woo-express-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/is-woo-express-rule-processor.php index 5db49ff717f..ba2bca4b7cf 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/is-woo-express-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/is-woo-express-rule-processor.php @@ -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. */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-date-time-provider.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-date-time-provider.php similarity index 87% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-date-time-provider.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-date-time-provider.php index e250192bb23..cc8c32321c2 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-date-time-provider.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-date-time-provider.php @@ -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; } } - diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-get-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-get-rule-processor.php similarity index 91% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-get-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-get-rule-processor.php index 5de623920a5..805e6aabca2 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-get-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-get-rule-processor.php @@ -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(); } } - diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-plugins-provider.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-plugins-provider.php similarity index 96% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-plugins-provider.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-plugins-provider.php index 72e4bc22b62..f9a14565af9 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-plugins-provider.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-plugins-provider.php @@ -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; /** diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-product-query.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-product-query.php similarity index 85% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-product-query.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-product-query.php index 681309d4045..8b3c0381e77 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-product-query.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-product-query.php @@ -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 { ); } } - diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-wc-admin-active-for-provider.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-wc-admin-active-for-provider.php similarity index 80% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-wc-admin-active-for-provider.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-wc-admin-active-for-provider.php index 37932001686..3f65b3f1030 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/mock-wc-admin-active-for-provider.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/mock-wc-admin-active-for-provider.php @@ -2,9 +2,11 @@ /** * Mock WCAdminActiveForProvider * - * @package WooCommerce\Admin\Tests\RemoteInboxNotifications + * @package WooCommerce\Admin\Tests\RemoteSpecs */ +declare( strict_types = 1 ); + /** * Mock WCAdminActiveForProvider */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/not-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/not-rule-processor.php similarity index 88% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/not-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/not-rule-processor.php index 9088cec3242..f2628792362 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/not-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/not-rule-processor.php @@ -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. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/onboarding-profile-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/onboarding-profile-rule-processor.php similarity index 87% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/onboarding-profile-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/onboarding-profile-rule-processor.php index 097670b0115..9f59c1ab06f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/onboarding-profile-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/onboarding-profile-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/option-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/option-rule-processor.php similarity index 93% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/option-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/option-rule-processor.php index 6e062f0ec7a..20f5dccad84 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/option-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/option-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/or-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/or-rule-processor.php similarity index 93% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/or-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/or-rule-processor.php index 6c93dfd1fb8..90c95605e1a 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/or-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/or-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/passing-rule-evaluator.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/passing-rule-evaluator.php similarity index 58% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/passing-rule-evaluator.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/passing-rule-evaluator.php index 9a504e784cd..f0d730f1ced 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/passing-rule-evaluator.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/passing-rule-evaluator.php @@ -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; } } diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/plugin-version-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/plugin-version-rule-processor.php similarity index 94% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/plugin-version-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/plugin-version-rule-processor.php index a38fdbb9a63..cd2d9c5811e 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/plugin-version-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/plugin-version-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/plugins-activated-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/plugins-activated-rule-processor.php similarity index 93% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/plugins-activated-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/plugins-activated-rule-processor.php index 41f478cedce..6250102b9bc 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/plugins-activated-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/plugins-activated-rule-processor.php @@ -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. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/product-count-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/product-count-rule-processor.php similarity index 81% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/product-count-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/product-count-rule-processor.php index a3ca1a8cb74..2e4b0e1891f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/product-count-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/product-count-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/publish-after-time-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/publish-after-time-rule-processor.php similarity index 90% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/publish-after-time-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/publish-after-time-rule-processor.php index 9aec0acfcfd..4057a9f1daf 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/publish-after-time-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/publish-after-time-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/publish-before-time-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/publish-before-time-rule-processor.php similarity index 90% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/publish-before-time-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/publish-before-time-rule-processor.php index 0234df59c87..60e23fbf5ec 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/publish-before-time-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/publish-before-time-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/stored-state-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/stored-state-rule-processor.php similarity index 97% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/stored-state-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/stored-state-rule-processor.php index 47567a6627d..ed1f616e67c 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/stored-state-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/stored-state-rule-processor.php @@ -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. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/total-payments-volume-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/total-payments-volume-processor.php similarity index 93% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/total-payments-volume-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/total-payments-volume-processor.php index d177dd8f975..7d11b482a78 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/total-payments-volume-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/total-payments-volume-processor.php @@ -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. diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformer-service.php similarity index 95% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformer-service.php index 224e7ba86e4..c5e17aee945 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformer-service.php @@ -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 */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-column.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-column.php similarity index 82% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-column.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-column.php index e5303725b37..bb1ed192b74 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-column.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-column.php @@ -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 ); } /** diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-flatten.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-flatten.php similarity index 92% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-flatten.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-flatten.php index b02ba40fff9..5e5d76c2834 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-flatten.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-flatten.php @@ -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; /** diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-keys.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-keys.php similarity index 77% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-keys.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-keys.php index b8e7d036192..f9e7b5df6c3 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-keys.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-keys.php @@ -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 */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-search.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-search.php similarity index 84% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-search.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-search.php index 46167d4b93e..17172146021 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-search.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-search.php @@ -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 ); } /** diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-values.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-values.php similarity index 77% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-values.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-values.php index efef87142be..18d96425cf4 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/array-values.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/array-values.php @@ -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 */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/count.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/count.php similarity index 76% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/count.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/count.php index 703a5804909..38f0f65ccb5 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/count.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/count.php @@ -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. */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/dot-notation.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/dot-notation.php similarity index 88% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/dot-notation.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/dot-notation.php index 1e74188467a..32f76474014 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/dot-notation.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/dot-notation.php @@ -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 ); } /** diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/prepare-url.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/prepare-url.php similarity index 84% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/prepare-url.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/prepare-url.php index a6f9d42478a..0e8c2145358 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/Transformers/prepare-url.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/transformers/prepare-url.php @@ -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. */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/wcadmin-active-for-rule-processor.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/wcadmin-active-for-rule-processor.php similarity index 93% rename from plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/wcadmin-active-for-rule-processor.php rename to plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/wcadmin-active-for-rule-processor.php index dca95841a92..8cd0349f66f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/wcadmin-active-for-rule-processor.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-specs/rule-processors/wcadmin-active-for-rule-processor.php @@ -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 *