Example #1
0
 function test_delete()
 {
     //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();
     //Act
     $test_checkout->delete();
     $result = Checkout::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Example #2
0
 function test_delete()
 {
     //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();
     $copy_id2 = 2;
     $patron_id2 = 1;
     $due_date2 = "2015-10-05";
     $test_checkout2 = new Checkout($copy_id2, $patron_id2, $due_date2);
     $test_checkout2->save();
     //Act
     $test_checkout->delete();
     //Assert
     $result = Checkout::getAll();
     $this->assertEquals([$test_checkout2], $result);
 }