コード例 #1
0
ファイル: ShipTest.php プロジェクト: dlashua/shipping
 public function setUp()
 {
     $s = new Shipment();
     $s->setFromStateProvinceCode('CA')->setFromPostalCode('90401')->setFromCountryCode('US')->setFromIsResidential(true)->setToPostalCode('78703')->setToCountryCode('US')->setToIsResidential(true);
     $p = new Package();
     $p->setWeight(3)->setWidth(9)->setLength(9)->setHeight(9);
     $s->addPackage($p);
     $this->shipment = $s;
 }
コード例 #2
0
ファイル: RateTest.php プロジェクト: dlashua/shipping
 public function setUp()
 {
     $ship = Ship::factory(['Standard Shipping' => ['ups' => ['03' => '1-5 business days']], 'Two-Day Shipping' => ['ups' => ['02' => '2 business days']], 'One-Day Shipping' => ['ups' => ['01' => 'next business day 10:30am', '13' => 'next business day by 3pm', '14' => 'next business day by 8am']]]);
     $this->approvedCodes = $ship->getApprovedCodes('ups');
     $package = new Package();
     $package->setWeight(3)->setWidth(9)->setLength(9)->setHeight(9);
     $this->shipment = new Shipment();
     $this->shipment->setFromStateProvinceCode('CA')->setFromPostalCode('90401')->setFromCountryCode('US')->setFromIsResidential(true)->setToPostalCode('78703')->setToCountryCode('US')->setToIsResidential(true)->addPackage($package);
 }
コード例 #3
0
ファイル: RateTest.php プロジェクト: dlashua/shipping
 public function setUp()
 {
     $ship = Ship::factory(['Standard Shipping' => ['usps' => ['1' => '1-3 business days', '4' => '2-8 business days']]]);
     $this->approvedCodes = $ship->getApprovedCodes('usps');
     $package = new Package();
     $package->setWeight(3)->setWidth(9)->setLength(9)->setHeight(9);
     $this->shipment = new Shipment();
     $this->shipment->setFromStateProvinceCode('CA')->setFromPostalCode('90401')->setFromCountryCode('US')->setToPostalCode('78703')->setToCountryCode('US')->setToIsResidential(true)->addPackage($package);
 }
コード例 #4
0
ファイル: FedexTest.php プロジェクト: dlashua/shipping
 public function setUp()
 {
     $ship = Ship::factory(['Standard Shipping' => ['fedex' => ['FEDEX_EXPRESS_SAVER' => '1-3 business days', 'FEDEX_GROUND' => '1-5 business days', 'GROUND_HOME_DELIVERY' => '1-5 business days']], 'Two-Day Shipping' => ['fedex' => ['FEDEX_2_DAY' => '2 business days']], 'One-Day Shipping' => ['fedex' => ['STANDARD_OVERNIGHT' => 'overnight']]]);
     $this->approvedCodes = $ship->getApprovedCodes('fedex');
     $package = new Package();
     $package->setWeight(3)->setWidth(9)->setLength(9)->setHeight(9);
     $this->shipment = new Shipment();
     $this->shipment->setFromStateProvinceCode('CA')->setFromPostalCode('90401')->setFromCountryCode('US')->setFromIsResidential(true)->setToPostalCode('78703')->setToCountryCode('US')->setToIsResidential(true)->addPackage($package);
 }
コード例 #5
0
 protected function getNoWeightPackage()
 {
     $noWeightPackage = new Package();
     $noWeightPackage->setHeight(10)->setWidth(10)->setWidth(6);
     return $noWeightPackage;
 }