@@ -188,48 +188,6 @@ public function test_build_marks_only_chosen_rate_as_selected(): void {
188188 $ this ->assertTrue ( $ by_id ['free_shipping:1 ' ]['is_selected ' ] );
189189 }
190190
191- /**
192- * @scenario Multiple packages, only the first package's chosen method drives selection
193- *
194- * Given a cart with two shipping packages each containing one rate
195- * And the chosen_shipping_methods session entry maps package 0 to the first rate
196- * When build() is called
197- * Then rates from both packages are included in the result
198- * And exactly one option across all packages is marked is_selected=true
199- */
200- public function test_build_aggregates_rates_from_multiple_packages (): void {
201- $ rate_a = $ this ->create_shipping_rate_stub ( 'flat_rate:1 ' , 'Zone A Flat ' , 3.0 );
202- $ rate_b = $ this ->create_shipping_rate_stub ( 'flat_rate:2 ' , 'Zone B Flat ' , 7.0 );
203-
204- $ packages = array (
205- $ this ->make_package ( array ( 'flat_rate:1 ' => $ rate_a ) ),
206- $ this ->make_package ( array ( 'flat_rate:2 ' => $ rate_b ) ),
207- );
208-
209- // Package 0 chosen method is flat_rate:1
210- $ this ->stub_wc ( $ packages , array ( 'flat_rate:1 ' , 'flat_rate:2 ' ) );
211-
212- $ wc_cart = Mockery::mock ( WC_Cart::class );
213- $ builder = new ShippingOptionsBuilder ();
214-
215- $ result = $ builder ->build ( $ wc_cart );
216-
217- $ this ->assertCount ( 2 , $ result );
218-
219- $ selected_count = 0 ;
220- $ ids = array ();
221- foreach ( $ result as $ option ) {
222- $ ids [] = $ option ['id ' ];
223- if ( $ option ['is_selected ' ] ) {
224- $ selected_count ++;
225- }
226- }
227-
228- $ this ->assertSame ( 1 , $ selected_count );
229- $ this ->assertContains ( 'flat_rate:1 ' , $ ids );
230- $ this ->assertContains ( 'flat_rate:2 ' , $ ids );
231- }
232-
233191 // -------------------------------------------------------------------------
234192 // Rule 5 — default to first rate when no session value
235193 // -------------------------------------------------------------------------
0 commit comments