Пример #1
0
 function test_getAllCheckouts()
 {
     //Arrange
     // create 2 test patrons.
     $name = "Suzie Palloozi";
     $phone = "1-800-439-0398";
     $test_patron = new Patron($name, $phone);
     $test_patron->save();
     // create 2 test checkouts. hard code copy_id for now
     $copy_id = 1;
     $patron_id = $test_patron->getId();
     $due_date = "2015-03-04";
     $test_checkout = new Checkout($copy_id, $patron_id, $due_date);
     $test_checkout->save();
     //Act
     $result = $test_patron->getAllCheckouts();
     //Assert
     $this->assertEquals([$test_checkout], $result);
 }