Beispiel #1
0
 function testUpdate()
 {
     $patron_name = "Jasmine";
     $new_patron = new Patron($patron_name);
     $new_patron->save();
     $new_patron->setPatronName("Jafar");
     $new_patron->update();
     $result = Patron::getAll();
     $this->assertEquals($new_patron, $result[0]);
 }
Beispiel #2
0
 function testSetPatronName()
 {
     //Arrange
     $patron_name = "Jim Joe";
     $test_patron = new Patron($patron_name);
     //Act
     $test_patron->setPatronName("Billy Bob");
     $result = $test_patron->getPatronName();
     //Assert
     $this->assertEquals("Billy Bob", $result);
 }
Beispiel #3
0
 function test_setPatronName()
 {
     //Arrange
     $patron_name = "Stephen King";
     $id = null;
     $test_patron = new Patron($patron_name, $id);
     //Act
     $test_patron->setPatronName("James Patterson");
     $result = $test_patron->getPatronName();
     //Assert
     $this->assertEquals("James Patterson", $result);
 }
 function testSetPatronName()
 {
     //Arrange
     $patron_name = "Sally";
     $phone_number = "1234567890";
     $test_patron = new Patron($patron_name, $phone_number);
     //Act
     $test_patron->setPatronName("Joe");
     $result = $test_patron->getPatronName();
     //Assert
     $this->assertEquals("Joe", $result);
 }
 function test_setPatornName()
 {
     //Arrange
     $name = "Ryan Seacrest";
     $id = 1;
     $test_patron = new Patron($name, $id);
     //Act
     $test_patron->setPatronName("George W. Bush");
     $result = $test_patron->getPatronName();
     //Assert
     $this->assertEquals($result, "George W. Bush");
 }
Beispiel #6
0
 function test_setPatronName()
 {
     //Arrange
     $patron_name = "Paco";
     $id = null;
     $test_patron = new Patron($patron_name, $id);
     $test_patron->save();
     //Act
     $new_name = "Burrito";
     $test_patron->setPatronName($new_name);
     $result = $test_patron->getPatronName();
     //Assert
     $this->assertEquals($new_name, $result);
 }