diff --git a/plugins/woocommerce/changelog/update-mothra_name_usage b/plugins/woocommerce/changelog/update-mothra_name_usage new file mode 100644 index 00000000000..38cc80f209a --- /dev/null +++ b/plugins/woocommerce/changelog/update-mothra_name_usage @@ -0,0 +1,4 @@ +Significance: minor +Type: tweak + +Update PHP unit tests to remove specific team names for generic names. 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-inbox-notifications/Transformers/array-column.php index 662f33506a5..e5303725b37 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-inbox-notifications/Transformers/array-column.php @@ -58,20 +58,20 @@ class WC_Admin_Tests_RemoteInboxNotifications_Transformers_ArrayColumn extends W public function test_it_returns_value_by_array_column() { $items = array( array( - 'name' => 'mothra', + 'name' => 'team-a', ), array( - 'name' => 'gezora', + 'name' => 'team-b', ), array( - 'name' => 'ghidorah', + 'name' => 'team-c', ), ); $arguments = (object) array( 'key' => 'name' ); $array_column = new ArrayColumn(); $result = $array_column->transform( $items, $arguments ); - $expected = array( 'mothra', 'gezora', 'ghidorah' ); + $expected = array( 'team-a', 'team-b', 'team-c' ); $this->assertEquals( $expected, $result ); } } 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-inbox-notifications/Transformers/dot-notation.php index 5f6bba6a2df..1e74188467a 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-inbox-notifications/Transformers/dot-notation.php @@ -51,11 +51,11 @@ class WC_Admin_Tests_RemoteInboxNotifications_Transformers_DotNotation extends W * Test it get getvalue by dot notation. */ public function test_it_can_get_value_by_dot_notation() { - $arguments = (object) array( 'path' => 'teams.mothra' ); + $arguments = (object) array( 'path' => 'teams.a' ); $items = array( 'teams' => array( - 'mothra' => 'nice!', + 'a' => 'nice!', ), ); @@ -72,7 +72,7 @@ class WC_Admin_Tests_RemoteInboxNotifications_Transformers_DotNotation extends W $items = array( 'teams' => array( - 'mothra' => 'nice!', + 'a' => 'nice!', ), ); 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-inbox-notifications/transformer-service.php index 6e6a9443f0f..224e7ba86e4 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-inbox-notifications/transformer-service.php @@ -109,24 +109,24 @@ class WC_Admin_Tests_RemoteInboxNotifications_TransformerService extends WC_Unit * When it uses DotNotation to select 'teams' * When it uses ArrayColumn to select 'members' in 'teams' * When it uses ArrayFlatten to flatten 'members' - * When it uses ArraySearch to select 'mothra-member' - * Then 'mothra-member' should be returned. + * When it uses ArraySearch to select 'team-a' + * Then 'team-a-member' should be returned. */ public function test_it_returns_transformed_value() { // Given. $items = array( 'teams' => array( array( - 'name' => 'mothra', - 'members' => array( 'mothra-member' ), + 'name' => 'team-a', + 'members' => array( 'team-a-member' ), ), array( - 'name' => 'gezora', - 'members' => array( 'gezora-member' ), + 'name' => 'team-b', + 'members' => array( 'team-b-member' ), ), array( - 'name' => 'ghidorah', - 'members' => array( 'ghidorah-member' ), + 'name' => 'team-c', + 'members' => array( 'team-c-member' ), ), ), ); @@ -135,12 +135,12 @@ class WC_Admin_Tests_RemoteInboxNotifications_TransformerService extends WC_Unit $dot_notation = $this->transformer_config( 'dot_notation', array( 'path' => 'teams' ) ); $array_column = $this->transformer_config( 'array_column', array( 'key' => 'members' ) ); $array_flatten = $this->transformer_config( 'array_flatten' ); - $array_search = $this->transformer_config( 'array_search', array( 'value' => 'mothra-member' ) ); + $array_search = $this->transformer_config( 'array_search', array( 'value' => 'team-a-member' ) ); $result = TransformerService::apply( $items, array( $dot_notation, $array_column, $array_flatten, $array_search ), false, null ); // Then. - $this->assertEquals( 'mothra-member', $result ); + $this->assertEquals( 'team-a-member', $result ); } /**