function test_getDueDate() { //Arrange $due_date = "0001-01-01"; $test_checkout = new Checkout($due_date); //Act $result = $test_checkout->getDueDate(); //Assert $this->assertEquals($due_date, $result); }
function testGetDueDate() { $due_date = "2015-09-10"; $copy_id = 1; $patron_id = 1; $checkin_status = 1; $test_checkout = new Checkout($due_date, $copy_id, $patron_id, $checkin_status); $result = $test_checkout->getDueDate(); $this->assertEquals($due_date, $result); }
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); }
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); }
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()); }