Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ivank committed May 4, 2015
1 parent 444cbf4 commit f12a6f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/Kohana/Jam/Behavior/Shippable/Brand/Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function model_call_total_delivery_time(Model_Brand_Purchase $brand_purch
public function model_call_delivery_time_dates(Model_Brand_Purchase $brand_purchase, Jam_Event_Data $data)
{
$delivery_time = $brand_purchase->total_delivery_time();
$start_date = $brand_purchase->payed_at() ?: time();
$start_date = $brand_purchase->paid_at() ?: time();

$data->return = new Jam_Range(array(
strtotime("{$start_date} + {$delivery_time->min()} weekdays"),
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/Jam/Behavior/Shippable/Brand/PurchaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ public function test_model_call_delivery_time_dates()
{
$range = new Jam_Range(array(10, 20));

$brand_purchase = $this->getMock('Model_Brand_Purchase', array('total_delivery_time', 'payed_at'), array('brand_purchase'));
$brand_purchase = $this->getMock('Model_Brand_Purchase', array('total_delivery_time', 'paid_at'), array('brand_purchase'));
$brand_purchase
->expects($this->once())
->method('total_delivery_time')
->will($this->returnValue($range));

$brand_purchase
->expects($this->once())
->method('payed_at')
->method('paid_at')
->will($this->returnValue('2013-02-02 10:00:00'));

$this->assertEquals(new Jam_Range(array(1361080800, 1362290400)), $brand_purchase->delivery_time_dates());
Expand Down

0 comments on commit f12a6f8

Please sign in to comment.