function testGetBookId() { $book_id = 1; $test_copy = new Copy($book_id); $result = $test_copy->getBookId(); $this->assertEquals($book_id, $result); }
function test_getBookId() { //Arrange $available = true; $book_id = 1; $test_copy = new Copy($available, $book_id); //Act $result = $test_copy->getBookId(); //Assert $this->assertEquals($book_id, $result); }
function test_addCopies() { //Arrange $book_name = "Slaughterhouse-5"; $test_book = new Book($book_name); $test_book->save(); //Act $test_book->addCopies(1); $test_copy = new Copy($test_book->getId()); $result = Copy::getAll(); //Assert $this->assertEquals($test_copy->getBookId(), $result[0]->getBookId()); }
function testUpdateBookId() { //Arrange $book_id = 1; $test_copy = new Copy($book_id); $test_copy->save(); $new_book_id = 3; //Act $test_copy->updateBookId($new_book_id); //Assert $this->assertEquals($test_copy->getBookId(), $new_book_id); }