コード例 #1
0
 function testUpdatePatronName()
 {
     $name = "Satan";
     $id = 1;
     $test_patron = new Patron($name, $id);
     $test_patron->save();
     $new_name = "Jesus";
     $test_patron->updatePatronName($new_name);
     $this->assertEquals("Jesus", $test_patron->getPatronName());
 }
コード例 #2
0
ファイル: PatronTest.php プロジェクト: jlbethel/library-1
 function testUpdatePatronName()
 {
     //Arrange
     $patron_name = "Joe Patron";
     $id = 1;
     $test_patron = new Patron($patron_name, $id);
     $test_patron->save();
     $new_name = "James Patron";
     //Act
     $test_patron->updatePatronName($new_name);
     //Assert
     $this->assertEquals("James Patron", $test_patron->getPatronName());
 }
コード例 #3
0
ファイル: PatronTest.php プロジェクト: jlbethel/Library
 function test_updatePatronName()
 {
     //Arrange
     $patron_name = "Hannibal";
     $test_patron = new Patron($patron_name);
     $test_patron->save();
     $patron_name2 = "Johnny";
     $test_patron->updatePatronName($patron_name2);
     //Act
     $id = $test_patron->getId();
     $result = new Patron($patron_name2, $id);
     //Assert
     $this->assertEquals(Patron::find($id), $result);
 }