/**
  * Execute resubmit to snap
  * @return bool
  */
 public function execute()
 {
     $run_count = 0;
     $this->out("=> Running resubmit to snap for shipments run count {$run_count}", 1, Shell::VERBOSE);
     $snap = new Snap();
     if (empty($this->shipment_ids)) {
         $this->out('=> Failed, no shipment ids found.');
         return false;
     }
     for ($i = 0; $i <= $run_count; $i++) {
         $shipment_id = $this->shipment_ids[$i];
         $this->out("Run: {$i}");
         if (!empty($shipment_id)) {
             $results = $snap->reSubmitExistingShipment($shipment_id);
             if ($results['success']) {
                 $this->out("=> Success: re-submitted {$shipment_id} to snap");
             } else {
                 $this->out("=> Failed: to resubmit {$shipment_id}");
             }
         } else {
             return false;
         }
     }
     return true;
 }
 public function testReSubmitShipment()
 {
     $this->test_order = new TestOrder(['database' => 'test', 'presenter_id' => 25, 'user_id' => 13, 'items' => [['qty' => 2, 'sku' => 'US-11101-02'], ['qty' => 2, 'sku' => 'US-85010-04']], 'address' => $this->addresses['US']]);
     $order_id = $this->test_order->create_test_order();
     $this->Order->id = $order_id;
     $order = $this->Order->loadDisplayDetails();
     $shipment_id = $order['OrderShipment'][0]['id'];
     $snap = new Snap();
     $response = $snap->createShipment($shipment_id);
     $this->assertTrue($response['success']);
     $response = $snap->reSubmitExistingShipment($shipment_id);
     $this->assertTrue($response['success']);
 }