예제 #1
0
 function testGetBillableHours()
 {
     # with discount
     $e = new Estimate();
     $e->set(array('name' => 'i am a test!'));
     $e->save();
     # gimme yo hours!
     $ho = new Hour();
     $ho->set(array('description' => 'did some stuff', 'date' => '2010-02-25', 'hours' => '2.75', 'estimate_id' => $e->id, 'discount' => '1'));
     $ho->save();
     # gimme yo hours!
     $ho2 = new Hour();
     $ho2->set(array('description' => 'did some more stuff', 'date' => '2010-02-26', 'hours' => '3', 'estimate_id' => $e->id, 'discount' => '1'));
     $ho2->save();
     # 1.75 + 2 = 3.75
     $date_range = array('start_date' => '2010-01-01', 'end_date' => '2010-03-01');
     $billable_hours = $e->getBillableHours($date_range);
     $this->assertEqual($billable_hours, 3.75);
     #destroy!!!!!
     $e->destroyAssociatedRecords();
     $e->delete();
 }
예제 #2
0
 /**
  * @covers Moneybird\Estimate::delete
  */
 public function testDelete()
 {
     $this->object->delete($this->service);
     $this->setExpectedException('Moneybird\\NotFoundException');
     $this->service->getById(self::$estimateId);
 }