예제 #1
0
 protected function tearDown()
 {
     Checkout::deleteAll();
     Patron::deleteAll();
     Book::deleteAll();
     Author::deleteAll();
 }
예제 #2
0
 protected function tearDown()
 {
     Copy::deleteAll();
     Book::deleteAll();
     Checkout::deleteAll();
     Patron::deleteAll();
 }
예제 #3
0
 function test_deleteAll()
 {
     //Arrange
     $due_date = "0001-01-01";
     $test_checkout = new Checkout($due_date);
     $test_checkout->save();
     $due_date2 = "2020-01-01";
     $test_checkout2 = new Checkout($due_date2);
     $test_checkout2->save();
     //Act
     Checkout::deleteAll();
     $result = Checkout::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
 function testDeleteAll()
 {
     //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();
     $due_date2 = "1989-09-04";
     $test_checkout2 = new Checkout($id, $patron_id, $copy_id, $due_date2);
     $test_checkout2->save();
     //Act
     Checkout::deleteAll();
     $result = Checkout::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
예제 #5
0
 function test_deleteAll()
 {
     //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();
     $due_date2 = "2020-01-01";
     $copy_id2 = 3;
     $patron_id2 = 4;
     $test_checkout2 = new Checkout($due_date2, $copy_id2, $patron_id2);
     $test_checkout2->save();
     //Act
     Checkout::deleteAll();
     $result = Checkout::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
예제 #6
0
 function test_deleteAll()
 {
     //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
     Checkout::deleteAll();
     //Assert
     $result = Checkout::getAll();
     $this->assertEquals([], $result);
 }
예제 #7
0
 function test_deleteAll()
 {
     //Arrange
     $checked_in_status = 1;
     $due_date = "8015-08-27";
     $copy_id = 1;
     $patron_id = 1;
     $test_checkout = new Checkout($checked_in_status, $due_date, $copy_id, $patron_id);
     $test_checkout->save();
     $checked_in_status2 = 0;
     $due_date2 = "9015-08-27";
     $copy_id2 = 2;
     $patron_id2 = 2;
     $test_checkout2 = new Checkout($checked_in_status2, $due_date2, $copy_id2, $patron_id2);
     $test_checkout2->save();
     //Act
     Checkout::deleteAll();
     $result = Checkout::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
예제 #8
0
 protected function tearDown()
 {
     Patron::deleteAll();
     Checkout::deleteAll();
 }
예제 #9
0
 function test_deleteAll()
 {
     //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();
     // Make a 2nd Checkout and save under the same patron
     $copy_id2 = 1;
     $due_date2 = "2015-08-09";
     $test_checkout2 = new Checkout($patron_id, $copy_id2, $due_date2);
     $test_checkout2->save();
     //Act
     Checkout::deleteAll();
     //Assert
     $result = Checkout::getAll();
     $this->assertEquals([], $result);
 }