Пример #1
0
 function testGetPatron()
 {
     //Arrange
     $book_id = 1;
     $id = 1;
     $test_copy = new Copy($book_id, $id);
     $test_copy->save();
     $name = "Ping Pong";
     $id2 = 1;
     $test_patron = new Patron($name, $id2);
     $test_patron->save();
     $name2 = "Ding Dong";
     $id3 = 2;
     $test_patron2 = new Patron($name2, $id3);
     $test_patron2->save();
     //Act
     $test_copy->addPatron($test_patron->getId());
     $test_copy->addPatron($test_patron2->getId());
     //Assert
     $this->assertEquals($test_copy->getPatron(), [$test_patron, $test_patron2]);
 }