コード例 #1
0
ファイル: BookTest.php プロジェクト: julianstewart/library
 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);
 }
コード例 #2
0
ファイル: BookTest.php プロジェクト: kylepratuch/library-1
 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());
 }
コード例 #3
0
ファイル: BookTest.php プロジェクト: juliocesardiaz/library-1
 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);
 }