function testGetBookTitle() { //arrange $book_title = 'Call of the Wild'; $test_book_title = new Book($book_title); var_dump($book_title); //act $result = $test_book_title->getBookTitle(); //assert $this->assertEquals($book_title, $result); }
function testUpdate() { //Arrange $book_title = "Snow Crash"; $id = null; $test_book = new Book($book_title, $id); $test_book->save(); $new_book_title = "Foundations Edge"; //Act $test_book->update($new_book_title); //Assert $this->assertEquals("Foundations Edge", $test_book->getBookTitle()); }
function test_searchTitle() { $title = "Three Blind Mice"; $test_book = new Book($title); $test_book->save(); $title2 = "Chicken Dog"; $test_book2 = new Book($title2); $test_book2->save(); $result = Book::searchTitle($test_book->getBookTitle()); $this->assertEquals([$test_book], $result); }