expectException( RouteException::class ); $class->validate_selected_shipping_methods( true, array( false ) ); } public function test_validate_selected_shipping_methods() { $class = new OrderController(); // By running this method we assert that it doesn't error because if it does this test will fail. $class->validate_selected_shipping_methods( true, array( 'free-shipping' ) ); $class->validate_selected_shipping_methods( false, array( 'free-shipping' ) ); $class->validate_selected_shipping_methods( true, null ); } }