diff --git a/composer.json b/composer.json index 41fa062..f7694c4 100644 --- a/composer.json +++ b/composer.json @@ -9,9 +9,6 @@ "email": "pdt256@gmail.com" } ], - "require": { - "nesbot/carbon": "~1.0" - }, "require-dev": { "phpunit/phpunit": "4.0.*" }, diff --git a/src/Fedex/Rate.php b/src/Fedex/Rate.php index 328bbac..26022cc 100644 --- a/src/Fedex/Rate.php +++ b/src/Fedex/Rate.php @@ -1,7 +1,7 @@ setCost((int) $cost * 100) ->setTransitTime($transit_time); if ($delivery_ts) { - $quote->setDeliveryEstimate(new Carbon($delivery_ts)); + $quote->setDeliveryEstimate(new DateTime($delivery_ts)); } $this->rates[] = $quote; diff --git a/src/Quote.php b/src/Quote.php index e37cb10..0daf8d4 100644 --- a/src/Quote.php +++ b/src/Quote.php @@ -1,6 +1,6 @@ delivery_ts = $estimate; return $this; diff --git a/tests/ShipTest.php b/tests/ShipTest.php index 4fa34df..f6cb5ee 100644 --- a/tests/ShipTest.php +++ b/tests/ShipTest.php @@ -1,5 +1,4 @@ setCode('FEDEX_EXPRESS_SAVER') ->setName('Fedex Express Saver') ->setCost(2900) - ->setDeliveryEstimate(new Carbon('2014-09-30T20:00:00')) + ->setDeliveryEstimate(new DateTime('2014-09-30T20:00:00')) ->setTransitTime(null); $secondday = new Quote; @@ -210,7 +209,7 @@ class ShipTest extends PHPUnit_Framework_TestCase ->setCode('FEDEX_2_DAY') ->setName('Fedex 2 Day') ->setCost(4000) - ->setDeliveryEstimate(new Carbon('2014-09-29T20:00:00')) + ->setDeliveryEstimate(new DateTime('2014-09-29T20:00:00')) ->setTransitTime(null); $overnight = new Quote; @@ -219,7 +218,7 @@ class ShipTest extends PHPUnit_Framework_TestCase ->setCode('STANDARD_OVERNIGHT') ->setName('Standard Overnight') ->setCost(7800) - ->setDeliveryEstimate(new Carbon('2014-09-26T20:00:00')) + ->setDeliveryEstimate(new DateTime('2014-09-26T20:00:00')) ->setTransitTime(null); $expected_result = [$ground, $express, $secondday, $overnight]; @@ -253,14 +252,14 @@ class ShipTest extends PHPUnit_Framework_TestCase $fedex_two_day->setCode('FEDEX_2_DAY') ->setName('Fedex 2 Day') ->setCost(4000) - ->setDeliveryEstimate(new Carbon('2014-09-29T20:00:00')) + ->setDeliveryEstimate(new DateTime('2014-09-29T20:00:00')) ->setCarrier('fedex'); $overnight = new Quote; $overnight->setCode('STANDARD_OVERNIGHT') ->setName('Standard Overnight') ->setCost(7800) - ->setDeliveryEstimate(new Carbon('2014-09-26T20:00:00')) + ->setDeliveryEstimate(new DateTime('2014-09-26T20:00:00')) ->setCarrier('fedex'); $this->assertEquals([