Beispiel #1
0
 function test_updateDueDate()
 {
     //Arrange
     $copy_id = 1;
     $patron_id = 4;
     $due_date = "2015-09-03";
     $test_checkout = new Checkout($copy_id, $patron_id, $due_date);
     $test_checkout->save();
     //Act
     $new_due_date = "2015-10-03";
     $test_checkout->updateDueDate($new_due_date);
     //Assert
     $result = Checkout::getAll();
     $this->assertEquals($new_due_date, $result[0]->getDueDate());
 }
Beispiel #2
0
 function test_updateDueDate()
 {
     //Arrange
     $due_date = "0001-01-01";
     $copy_id = 1;
     $patron_id = 2;
     $test_checkout = new Checkout($due_date, $copy_id, $patron_id);
     $test_checkout->save();
     $new_due_date = "2015-11-11";
     $test_checkout->updateDueDate($new_due_date);
     //Act
     $id = $test_checkout->getId();
     $result = new Checkout($new_due_date, $copy_id, $patron_id, $id);
     //Assert
     $this->assertEquals(Checkout::findDueDate($id), $result);
 }
Beispiel #3
0
 function test_updateDueDate()
 {
     //Arrange
     // Make a Patron
     $name = "Dan Brown";
     $phone = "3";
     $email = "*****@*****.**";
     $test_patron = new Patron($name, $phone, $email);
     $test_patron->save();
     // Make a Checkout and save
     $patron_id = $test_patron->getId();
     $copy_id = 1;
     $due_date = "2015-08-09";
     $test_checkout = new Checkout($patron_id, $copy_id, $due_date);
     $test_checkout->save();
     $new_due_date = "2015-08-27";
     //Act
     $test_checkout->updateDueDate($new_due_date);
     //Assert
     $result = $test_checkout->getDueDate();
     $this->assertEquals($new_due_date, $result);
 }