From 3406bd85e03f0abab8f27b0e4a59c97ca4059e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Fri, 13 Sep 2019 18:39:51 +0200 Subject: [PATCH] Fix variable name typo (https://github.com/woocommerce/woocommerce-admin/pull/2922) --- plugins/woocommerce-admin/src/ReportsSync.php | 12 ++++++------ plugins/woocommerce-admin/tests/batch-queue.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/woocommerce-admin/src/ReportsSync.php b/plugins/woocommerce-admin/src/ReportsSync.php index bff435fafa7..53fe2636979 100644 --- a/plugins/woocommerce-admin/src/ReportsSync.php +++ b/plugins/woocommerce-admin/src/ReportsSync.php @@ -27,7 +27,7 @@ class ReportsSync { /** * Action hook for queuing an action after another is complete. */ - const QUEUE_DEPEDENT_ACTION = 'wc-admin_queue_dependent_action'; + const QUEUE_DEPENDENT_ACTION = 'wc-admin_queue_dependent_action'; /** * Action hook for importing a batch of customers. @@ -118,7 +118,7 @@ class ReportsSync { // Initialize scheduled action handlers. add_action( self::QUEUE_BATCH_ACTION, array( __CLASS__, 'queue_batches' ), 10, 4 ); - add_action( self::QUEUE_DEPEDENT_ACTION, array( __CLASS__, 'queue_dependent_action' ), 10, 3 ); + add_action( self::QUEUE_DEPENDENT_ACTION, array( __CLASS__, 'queue_dependent_action' ), 10, 3 ); add_action( self::CUSTOMERS_IMPORT_BATCH_ACTION, array( __CLASS__, 'customer_lookup_import_batch' ), 10, 3 ); add_action( self::CUSTOMERS_DELETE_BATCH_INIT, array( __CLASS__, 'customer_lookup_delete_batch_init' ) ); add_action( self::CUSTOMERS_DELETE_BATCH_ACTION, array( __CLASS__, 'customer_lookup_delete_batch' ) ); @@ -226,7 +226,7 @@ class ReportsSync { // If we're using our data store, call our bespoke deletion method. $action_types = array( self::QUEUE_BATCH_ACTION, - self::QUEUE_DEPEDENT_ACTION, + self::QUEUE_DEPENDENT_ACTION, self::CUSTOMERS_IMPORT_BATCH_ACTION, self::CUSTOMERS_DELETE_BATCH_INIT, self::CUSTOMERS_DELETE_BATCH_ACTION, @@ -305,7 +305,7 @@ class ReportsSync { if ( ( self::SINGLE_ORDER_IMPORT_ACTION === $existing_job->get_hook() ) || ( - self::QUEUE_DEPEDENT_ACTION === $existing_job->get_hook() && + self::QUEUE_DEPENDENT_ACTION === $existing_job->get_hook() && in_array( self::SINGLE_ORDER_IMPORT_ACTION, $existing_job->get_args(), true ) ) ) { @@ -602,11 +602,11 @@ class ReportsSync { // Also, ensure that the next schedule is a DateTime (it can be null). if ( is_a( $next_job_schedule, 'DateTime' ) && - ( self::QUEUE_DEPEDENT_ACTION !== $blocking_job_hook ) + ( self::QUEUE_DEPENDENT_ACTION !== $blocking_job_hook ) ) { self::queue()->schedule_single( $next_job_schedule->getTimestamp() + 5, - self::QUEUE_DEPEDENT_ACTION, + self::QUEUE_DEPENDENT_ACTION, array( $action, $action_args, $prerequisite_action ), self::QUEUE_GROUP ); diff --git a/plugins/woocommerce-admin/tests/batch-queue.php b/plugins/woocommerce-admin/tests/batch-queue.php index 446960649a1..25219cf1fef 100644 --- a/plugins/woocommerce-admin/tests/batch-queue.php +++ b/plugins/woocommerce-admin/tests/batch-queue.php @@ -154,7 +154,7 @@ class WC_Tests_Reports_Regenerate_Batching extends WC_REST_Unit_Test_Case { 1, ReportsSync::queue()->search( array( - 'hook' => ReportsSync::QUEUE_DEPEDENT_ACTION, + 'hook' => ReportsSync::QUEUE_DEPENDENT_ACTION, 'args' => array( 'dependent_action', array(), 'blocking_job' ), ) ) @@ -175,7 +175,7 @@ class WC_Tests_Reports_Regenerate_Batching extends WC_REST_Unit_Test_Case { $this->assertEmpty( ReportsSync::queue()->search( array( - 'hook' => ReportsSync::QUEUE_DEPEDENT_ACTION, + 'hook' => ReportsSync::QUEUE_DEPENDENT_ACTION, 'args' => array( 'another_dependent_action', array(), 'nonexistant_blocking_job' ), ) ) @@ -183,6 +183,6 @@ class WC_Tests_Reports_Regenerate_Batching extends WC_REST_Unit_Test_Case { // clean up. ReportsSync::queue()->cancel_all( 'another_dependent_action' ); - ReportsSync::queue()->cancel_all( ReportsSync::QUEUE_DEPEDENT_ACTION ); + ReportsSync::queue()->cancel_all( ReportsSync::QUEUE_DEPENDENT_ACTION ); } }