コード例 #1
0
ファイル: CheckoutTest.php プロジェクト: ashlinaronin/library
 protected function tearDown()
 {
     Checkout::deleteAll();
     Patron::deleteAll();
     Book::deleteAll();
     Author::deleteAll();
 }
コード例 #2
0
ファイル: CopyTest.php プロジェクト: kevintokheim/Library
 protected function tearDown()
 {
     Copy::deleteAll();
     Book::deleteAll();
     Checkout::deleteAll();
     Patron::deleteAll();
 }
コード例 #3
0
ファイル: CheckoutTest.php プロジェクト: jlbethel/Library
 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);
 }
コード例 #4
0
 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
ファイル: CheckoutTest.php プロジェクト: jlbethel/library-1
 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
ファイル: CheckoutTest.php プロジェクト: alexdbrown/library
 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
ファイル: CheckoutTest.php プロジェクト: kevintokheim/Library
 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
ファイル: PatronTest.php プロジェクト: r-hills/library-1
 protected function tearDown()
 {
     Patron::deleteAll();
     Checkout::deleteAll();
 }
コード例 #9
0
ファイル: CheckoutTest.php プロジェクト: r-hills/Library
 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);
 }