/**
  * When filtering from a list with a grouped item, the grouped item item,
  * which will simply be one of the items added by the group, should be included.
  */
 public function testSelectFromGroupedProducts()
 {
     $groupedItem = $this->_mockItem(Mage_Catalog_Model_Product_Type::TYPE_GROUPED);
     $selectedItems = $this->_itemSelection->selectFrom([$groupedItem]);
     $this->assertCount(1, $selectedItems);
     $this->assertSame([$groupedItem], $selectedItems);
 }
 /**
  * Get all items shipping to a given address. For billing addresses, this
  * will be all virtual items in the order. For shipping addresses, any
  * non-virtual items. Only items that are to be included in the order create
  * request should be returned.
  *
  * @param Mage_Customer_Model_Address_Abstract
  * @param Mage_Sales_Model_Resource_Order_Item_Collection
  * @return Mage_Sales_Model_Order_Item[]
  */
 protected function _getItemsForAddress(Mage_Customer_Model_Address_Abstract $address, Mage_Sales_Model_Resource_Order_Item_Collection $orderItems)
 {
     // All items will have an `order_address_id` matching the id of the
     // address the item ships to (including virtual items which "ship" to
     // the billing address).
     // Filter the given collection instead of using address methods to get
     // items to prevent loading separate item collections for each address.
     return $this->_itemSelection->selectFrom($orderItems->getItemsByColumnValue('order_address_id', $address->getId()));
 }