Example #1
0
 function testDelete()
 {
     $name = "Randy Mclure";
     $test_patron = new Patron($name);
     $test_patron->save();
     $name2 = "Ballface Majure";
     $test_patron2 = new Patron($name2);
     $test_patron2->save();
     $test_patron->delete();
     $this->assertEquals([$test_patron2], Patron::getAll());
 }
Example #2
0
 function testDelete()
 {
     //Arrange
     $name = "Kyle Pratuch";
     $email = "*****@*****.**";
     $test_patron = new Patron($name, $email);
     $test_patron->save();
     $name2 = "Jason Bethel";
     $email2 = "*****@*****.**";
     $test_patron2 = new Patron($name2, $email2);
     $test_patron2->save();
     //Act
     $test_patron->delete();
     $result = Patron::getAll();
     //Assert
     $this->assertEquals([$test_patron2], $result);
 }
Example #3
0
 function test_delete()
 {
     //Arrange
     $name = "Suzie Palloozi";
     $phone = "1-800-439-0398";
     $test_patron = new Patron($name, $phone);
     $test_patron->save();
     $name2 = "Tac Zoltani";
     $phone2 = "1-800-407-3930";
     $test_patron2 = new Patron($name2, $phone2);
     $test_patron2->save();
     //Act
     $test_patron->delete();
     //Assert
     $result = Patron::getAll();
     $this->assertEquals($test_patron2, $result[0]);
 }
Example #4
0
 function test_delete()
 {
     //Arrange
     $name = "Dan Brown";
     $phone = "3";
     $email = "*****@*****.**";
     $test_patron = new Patron($name, $phone, $email);
     $test_patron->save();
     $name2 = "Ian Browne";
     $phone2 = "4";
     $email2 = "*****@*****.**";
     $test_patron2 = new Patron($name2, $phone2, $email2);
     $test_patron2->save();
     //Act
     $test_patron->delete();
     $result = Patron::getAll();
     //Assert
     $this->assertEquals([$test_patron2], $result);
 }
Example #5
0
 function testDelete()
 {
     //Arrange
     $due_date = "2015-10-10";
     $book_id = 1;
     $id = 1;
     $test_copy = new Copy($due_date, $book_id, $id);
     $test_copy->save();
     $name = "Jim Bob";
     $id = 1;
     $test_patron = new Patron($name, $id);
     $test_patron->save();
     //Act
     $test_patron->addCopy($test_copy);
     $test_patron->delete();
     //Assert
     $this->assertEquals([], $test_copy->getPatrons());
 }
 function testDelete()
 {
     //Arrange
     $id = null;
     $name = "Allen";
     $phone = "4444";
     $test_patron = new Patron($id, $name, $phone);
     $name2 = "Phil";
     $phone2 = "5555";
     $test_patron2 = new Patron($id, $name2, $phone2);
     $test_patron2->save();
     //Act
     $test_patron->delete();
     //Assert
     $this->assertEquals([$test_patron2], Patron::getAll());
 }
Example #7
0
 function testDeletePatron()
 {
     //Arrange
     $patron_name = "Mr. Pickles";
     $id = null;
     $test_patron = new Patron($patron_name, $id);
     $test_patron->save();
     $patron_name2 = "John Doe";
     $test_patron2 = new Patron($patron_name2, $id);
     $test_patron2->save();
     //Act
     $test_patron2->delete();
     //Assert
     $result = Patron::getAll();
     $this->assertEquals([$test_patron], $result);
 }