function testUpdate()
 {
     //Arrange
     $id = null;
     $patron_id = null;
     $copy_id = null;
     $due_date = "2012-12-12";
     $test_checkout = new Checkout($id, $patron_id, $copy_id, $due_date);
     $test_checkout->save();
     $new_due_date = "2013-03-05";
     //Act
     $test_checkout->update($new_due_date);
     //Assert
     $result = $test_checkout->getDueDate();
     $this->assertEquals($new_due_date, $result);
 }
예제 #2
0
 function test_update()
 {
     //Arrange
     $checked_in_status = 0;
     $due_date = "2000 BC";
     $copy_id = 4;
     $patron_id = 4;
     $test_checkout = new Checkout($checked_in_status, $due_date, $copy_id, $patron_id);
     $test_checkout->save();
     $checked_in_status2 = 1;
     $due_date2 = "2015-27-08";
     $copy_id2 = 5;
     $patron_id2 = 5;
     $test_checkout2 = new Checkout($checked_in_status2, $due_date2, $copy_id2, $patron_id2);
     $test_checkout2->save();
     //Act
     $test_checkout->update($checked_in_status2, $due_date2);
     //Assert
     $this->assertEquals($test_checkout2->getDueDate(), $test_checkout->getDueDate());
 }