本文整理汇总了PHP中Book::deleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Book::deleteAll方法的具体用法?PHP Book::deleteAll怎么用?PHP Book::deleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book::deleteAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
Author::deleteAll();
Book::deleteAll();
Patron::deleteAll();
Copies::deleteAll();
}
示例2: tearDown
protected function tearDown()
{
Checkout::deleteAll();
Book::deleteAll();
Author::deleteAll();
Patron::deleteAll();
}
示例3: tearDown
protected function tearDown()
{
Copy::deleteAll();
Book::deleteAll();
Checkout::deleteAll();
Patron::deleteAll();
}
示例4: tearDown
protected function tearDown()
{
Book::deleteAll();
Copy::deleteAll();
Author::deleteAll();
Patron::deleteAll();
}
示例5: test_deleteAll
function test_deleteAll()
{
//Arrange
$title = "History of whatever";
$test_book = new Book($title);
$test_book->save();
$title2 = "History of nothing";
$test_book2 = new Book($title2);
$test_book2->save();
//Act
Book::deleteAll();
$result = Book::getAll();
//Assert
$this->assertEquals([], $result);
}
示例6: testDeleteAll
function testDeleteAll()
{
//Arrange
$title = "Title";
$test_book = new Book($title);
$test_book->save();
$title2 = "New Title";
$test_book2 = new Book($title2);
$test_book2->save();
//Act
Book::deleteAll();
$result = Book::getAll();
//Assert
$this->assertEquals([], $result);
}
示例7: testDeleteAll
function testDeleteAll()
{
//Arrange
$id = null;
$name = "A Series of Unfortunate Events";
$test_book = new Book($id, $name);
$test_book->save();
$name2 = "Fresh Off the Boat";
$test_book2 = new Book($id, $name2);
$test_book2->save();
//Act
Book::deleteAll();
$result = Book::getAll();
//Assert
$this->assertEquals([], $result);
}
示例8: testDeleteAll
function testDeleteAll()
{
//Arrange
$book_name = "Intro to Art";
$test_book = new Book($book_name);
$test_book->save();
$book_name2 = "Intro to Spanish";
$book_author2 = "SPN101";
$test_book2 = new Book($book_name2);
$test_book2->save();
//Act
Book::deleteAll();
$result = Book::getAll();
//Assert
$this->assertEquals([], $result);
}
示例9: testDeleteAll
function testDeleteAll()
{
//Arrange
$title = "Where the Red Fern Grows";
$id = null;
$test_book = new Book($title, $id);
$test_book->save();
$title2 = "Where the Wild Things Are";
$test_book2 = new Book($title2, $id);
$test_book2->save();
//Act
Book::deleteAll();
//Assert
$result = Book::getAll();
$this->assertEquals([], $result);
}
示例10: testDeleteAll
function testDeleteAll()
{
//Arrange
$title = "Harry Potter";
$id = 1;
$test_book = new Book($title, $id);
$test_book->save();
$title2 = "Moby Dick";
$id2 = 2;
$test_book2 = new Book($title, $id);
$test_book2->save();
//Act
Book::deleteAll();
$result = Book::getAll();
//Assert
$this->assertEquals([], $result);
}
示例11: test_deleteAll
function test_deleteAll()
{
//Arrange
$title = "Whimsical Fairytales...and other stories";
$genre = "Fantasy";
$test_book = new Book($title, $genre);
$test_book->save();
$title2 = "The Secret Life of Garden Gnomes";
$genre2 = "Nonfiction";
$test_book2 = new Book($title2, $genre2);
$test_book2->save();
//Act
Book::deleteAll();
//Assert
$result = Book::getAll();
$this->assertEquals([], $result);
}
示例12: test_deleteAll
function test_deleteAll()
{
//Arrange
$title = "World War Z";
$genre = "Horror";
$test_book = new Book($title, $genre);
$test_book->save();
$name2 = "Billy Bartle-Barnaby";
$enroll_date2 = "2015-07-09";
$test_book2 = new Book($name2, $enroll_date2);
$test_book2->save();
//Act
Book::deleteAll();
//Assert
$result = Book::getAll();
$this->assertEquals([], $result);
}
示例13: test_deleteAll
function test_deleteAll()
{
//Arrange
$author_first = "Dr.";
$author_last = "Seuss";
$title = "The Cat in the Hat";
$test_book = new Book($author_first, $author_last, $title);
$test_book->save();
$author_first2 = "Stephen";
$author_last2 = "King";
$title2 = "Misery";
$test_book2 = new Book($author_first2, $author_last2, $title2);
$test_book2->save();
//Act
Book::deleteAll();
//Assert
$result = Book::getAll();
$this->assertEquals([], $result);
}
示例14: testDeleteAll
function testDeleteAll()
{
//Arrange
$title = "Speaker for the Dead";
$date = "1987";
$id = null;
$test_book = new Book($title, $date, $id);
$test_book->save();
$title2 = "Frankenstein";
$date2 = "1750";
$id2 = null;
$test_book2 = new Book($title2, $date2, $id2);
$test_book2->save();
//Act
Book::deleteAll();
//Assert
$result = Book::getAll();
$this->assertEquals([], $result);
}
示例15: array
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
use Symfony\Component\HttpFoundation\Request;
Request::enableHttpMethodParameterOverride();
// HOME PAGE - DISPLAYS ADMIN LINK AND PATRON LINK
$app->get('/', function () use($app) {
return $app['twig']->render('index.html.twig');
});
// ADMIN PAGE - DISPLAYS BOOK CATALOG
$app->get("/main_admin", function () use($app) {
$books = Book::getAll();
$authors = Author::getAll();
return $app['twig']->render("main_admin.html.twig", array('books' => $books, 'authors' => $authors));
});
$app->post("/delete_books", function () use($app) {
$GLOBALS['DB']->exec("DELETE FROM books;");
Book::deleteAll();
return $app['twig']->render('main_admin.html.twig', array('books' => Book::getAll()));
});
//add new book with author
$app->post("/book_added", function () use($app) {
// create new book from user entry "add book"
$title = $_POST['title'];
$new_book = new Book($title);
$new_book->save();
// create new author from user entry "add book"
// possibly check that the author is already in the database - NOT NOW
$name_array = explode(',', $_POST['name']);
foreach ($name_array as $name) {
$new_author = new Author($name);
$new_author->save();
$new_book->addAuthor($new_author);