Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
brent committed Oct 30, 2024
1 parent 26daa42 commit 76b49fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/OrderStatusEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,22 @@ public function test_change_order_status() {
$order_id = $events[0]['properties.$order_id'];
$order = wc_get_order( $order_id );
$order->update_status( 'cancelled', '', true );
static::fail_on_error_logged();
static::assertOrderStatusEventTriggered(
[
'$source' => '$manual_review',
'$order_status' => '$canceled',
]
);

// Let's try an unsupported status.
$gold_status_filter = fn( $statuses ) => array_merge( $statuses, [ 'wc-gold' => 'Gold' ] );
add_filter( 'wc_order_statuses', $gold_status_filter );
$order->update_status( 'gold', '', true );
static::assertNotEmpty( static::$errors, 'No error logged for unsupported status' );

// Clean up
remove_filter( 'wc_order_statuses', $gold_status_filter );
wp_delete_user( $user_id );
}

Expand All @@ -64,7 +72,7 @@ public function test_change_order_status() {
*
* @param array $props Event properties.
*
* @return void
* @return array Return the matching events.
*/
public static function assertOrderStatusEventTriggered( array $props = [] ) {
$filters = [ 'event' => '$order_status' ];
Expand Down

0 comments on commit 76b49fe

Please sign in to comment.