@@ -41,12 +41,12 @@ public function test_all_meta_fields_should_be_added( string $meta_type ) {
4141 $ next_mid = self ::get_autoincrement ( $ meta_type );
4242
4343 // Set up mock actions and filters to track calls.
44- $ action1 = new MockAction ();
45- $ action2 = new MockAction ();
46- $ action3 = new MockAction ();
47- add_filter ( "add_ {$ meta_type }_metadata " , array ( $ action1 , 'filter ' ), 10 , 5 );
48- add_action ( "add_ {$ meta_type }_meta " , array ( $ action2 , 'action ' ) );
49- add_action ( "added_ {$ meta_type }_meta " , array ( $ action3 , 'action ' ) );
44+ $ add_metadata_filter = new MockAction ();
45+ $ add_meta_action = new MockAction ();
46+ $ added_meta_action = new MockAction ();
47+ add_filter ( "add_ {$ meta_type }_metadata " , array ( $ add_metadata_filter , 'filter ' ), 10 , 5 );
48+ add_action ( "add_ {$ meta_type }_meta " , array ( $ add_meta_action , 'action ' ) );
49+ add_action ( "added_ {$ meta_type }_meta " , array ( $ added_meta_action , 'action ' ) );
5050
5151 // Bulk add the meta.
5252 $ result = bulk_add_metadata ( $ meta_type , $ object_id , $ meta );
@@ -67,9 +67,9 @@ public function test_all_meta_fields_should_be_added( string $meta_type ) {
6767
6868 $ this ->assertSame ( $ meta , $ actual_vals , 'Actual meta values should match expected values. ' );
6969 $ this ->assertSame ( $ expected_mids , $ result , 'Actual meta IDs should match expected meta IDs. ' );
70- $ this ->assertSame ( 3 , $ action1 ->get_call_count (), "'add_ {$ meta_type }_metadata' filter should be called the correct number of times. " );
71- $ this ->assertSame ( 3 , $ action2 ->get_call_count (), "'add_ {$ meta_type }_meta' action should be called the correct number of times. " );
72- $ this ->assertSame ( 3 , $ action3 ->get_call_count (), "'added_ {$ meta_type }_meta' action should be called the correct number of times. " );
70+ $ this ->assertSame ( 3 , $ add_metadata_filter ->get_call_count (), "'add_ {$ meta_type }_metadata' filter should be called the correct number of times. " );
71+ $ this ->assertSame ( 3 , $ add_meta_action ->get_call_count (), "'add_ {$ meta_type }_meta' action should be called the correct number of times. " );
72+ $ this ->assertSame ( 3 , $ added_meta_action ->get_call_count (), "'added_ {$ meta_type }_meta' action should be called the correct number of times. " );
7373 }
7474
7575 /**
@@ -103,12 +103,12 @@ static function ( $check, $object_id, $meta_key ) {
103103 $ next_mid = self ::get_autoincrement ( $ meta_type );
104104
105105 // Set up mock actions and filters to track calls.
106- $ action1 = new MockAction ();
107- $ action2 = new MockAction ();
108- $ action3 = new MockAction ();
109- add_filter ( "add_ {$ meta_type }_metadata " , array ( $ action1 , 'filter ' ), 10 , 5 );
110- add_action ( "add_ {$ meta_type }_meta " , array ( $ action2 , 'action ' ) );
111- add_action ( "added_ {$ meta_type }_meta " , array ( $ action3 , 'action ' ) );
106+ $ add_metadata_filter = new MockAction ();
107+ $ add_meta_action = new MockAction ();
108+ $ added_meta_action = new MockAction ();
109+ add_filter ( "add_ {$ meta_type }_metadata " , array ( $ add_metadata_filter , 'filter ' ), 10 , 5 );
110+ add_action ( "add_ {$ meta_type }_meta " , array ( $ add_meta_action , 'action ' ) );
111+ add_action ( "added_ {$ meta_type }_meta " , array ( $ added_meta_action , 'action ' ) );
112112
113113 // Bulk add the meta.
114114 $ result = bulk_add_metadata ( $ meta_type , $ object_id , $ meta );
@@ -136,9 +136,9 @@ static function ( $check, $object_id, $meta_key ) {
136136
137137 $ this ->assertSame ( $ expected_vals , $ actual_vals , 'Actual meta values should match expected values. ' );
138138 $ this ->assertSame ( $ expected_mids , $ result , 'Actual meta IDs should match expected meta IDs. ' );
139- $ this ->assertSame ( 3 , $ action1 ->get_call_count (), "'add_ {$ meta_type }_metadata' filter should be called the correct number of times. " );
140- $ this ->assertSame ( 2 , $ action2 ->get_call_count (), "'add_ {$ meta_type }_meta' action should be called the correct number of times. " );
141- $ this ->assertSame ( 2 , $ action3 ->get_call_count (), "'added_ {$ meta_type }_meta' action should be called the correct number of times. " );
139+ $ this ->assertSame ( 3 , $ add_metadata_filter ->get_call_count (), "'add_ {$ meta_type }_metadata' filter should be called the correct number of times. " );
140+ $ this ->assertSame ( 2 , $ add_meta_action ->get_call_count (), "'add_ {$ meta_type }_meta' action should be called the correct number of times. " );
141+ $ this ->assertSame ( 2 , $ added_meta_action ->get_call_count (), "'added_ {$ meta_type }_meta' action should be called the correct number of times. " );
142142 }
143143
144144 /**
0 commit comments