本文整理汇总了PHP中Author::deleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::deleteAll方法的具体用法?PHP Author::deleteAll怎么用?PHP Author::deleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::deleteAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
Checkout::deleteAll();
Book::deleteAll();
Author::deleteAll();
Patron::deleteAll();
}
示例2: tearDown
protected function tearDown()
{
Author::deleteAll();
Book::deleteAll();
Patron::deleteAll();
Copies::deleteAll();
}
示例3: tearDown
protected function tearDown()
{
Book::deleteAll();
Copy::deleteAll();
Author::deleteAll();
Patron::deleteAll();
}
示例4: tearDown
protected function tearDown()
{
Book::deleteAll();
Author::deleteAll();
$GLOBALS['DB']->exec("DELETE FROM authors_books;");
$GLOBALS['DB']->exec("DELETE FROM copies;");
}
示例5: testDeleteAll
function testDeleteAll()
{
$author_name = "Murakami";
$id = 1;
$test_author = new Author($author_name, $id);
$test_author->save();
$author_name = "Linux";
$test_author2 = new Author($author_name);
$test_author2->save();
Author::deleteAll();
$result = Author::getAll();
$this->assertEquals([], $result);
}
示例6: test_deleteAll
function test_deleteAll()
{
//Arrange
$name = "Bob";
$test_author = new Author($name);
$test_author->save();
$name2 = "Billy Bob";
$test_author2 = new Author($name2);
$test_author2->save();
//Act
Author::deleteAll();
$result = Author::getAll();
//Assert
$this->assertEquals([], $result);
}
示例7: testDeleteAll
function testDeleteAll()
{
//Arrange
$name = "Intro to Art";
$test_author = new Author($name);
$test_author->save();
$name2 = "Intro to Spanish";
$test_author2 = new Author($name2);
$test_author2->save();
//Act
Author::deleteAll();
$result = Author::getAll();
//Assert
$this->assertEquals([], $result);
}
示例8: testDeleteAll
function testDeleteAll()
{
//Arrange
$id = null;
$name = "Lemony Snicket";
$test_author = new Author($id, $name);
$test_author->save();
$name2 = "J.R.R. Tolkien";
$test_author2 = new Author($id, $name2);
$test_author2->save();
//Act
Author::deleteAll();
//Assert
$result = Author::getAll();
$this->assertEquals([], $result);
}
示例9: testDeleteAll
function testDeleteAll()
{
//Arrange
$name = "Nathan Young";
$id = null;
$test_author = new Author($name, $id);
$test_author->save();
$name2 = "Kyle Pratuch";
$test_author2 = new Author($name2, $id);
$test_author2->save();
//Act
Author::deleteAll();
//Assert
$result = Author::getAll();
$this->assertEquals([], $result);
}
示例10: testDeleteAll
function testDeleteAll()
{
//Arrange
$name = "JK Rowling";
$id = 1;
$test_author = new Author($name, $id);
$test_author->save();
$name2 = "George RR Martin";
$id2 = 2;
$test_author2 = new Author($name, $id);
$test_author2->save();
//Act
Author::deleteAll();
$result = Author::getAll();
//Assert
$this->assertEquals([], $result);
}
示例11: test_deleteAll
function test_deleteAll()
{
//Arrange
$name = "Paul Jones";
$id = 1;
$name2 = "Steve Smith";
$id2 = 2;
$test_author = new Author($name, $id);
$test_author->save();
$test_author2 = new Author($name, $id2);
$test_author2->save();
//Act
Author::deleteAll();
$result = Author::getAll();
//Assert
$this->assertEquals([], $result);
}
示例12: array
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get("/", function () use($app) {
return $app['twig']->render('index.html.twig', array('books' => Book::getAll(), 'authors' => Author::getAll()));
});
$app->get("/books", function () use($app) {
return $app['twig']->render('books.html.twig', array('books' => Book::getAll()));
});
$app->post("/books", function () use($app) {
$book_title = $_POST['book_title'];
$book = new Book($book_title);
$book->save();
return $app['twig']->render('books.html.twig', array('books' => Book::getAll()));
});
$app->post("/delete_books", function () use($app) {
Book::deleteAll();
return $app['twig']->render('books.html.twig', array('books' => Book::getAll()));
});
$app->get("/authors", function () use($app) {
return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll()));
});
$app->post("/authors", function () use($app) {
$name = $_POST['name'];
$author = new Author($name);
$author->save();
return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll()));
});
$app->post("/delete_authors", function () use($app) {
Author::deleteAll();
return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll()));
});
return $app;
示例13: tearDown
protected function tearDown()
{
Book::deleteAll();
Author::deleteAll();
BookList::deleteAll();
}
示例14: testDeleteAllWithLimitAndOrder
public function testDeleteAllWithLimitAndOrder()
{
if (!$this->conn->acceptsLimitAndOrderForUpdateAndDelete()) {
$this->markTestSkipped('Only MySQL & Sqlite accept limit/order with UPDATE clause');
}
$numAffected = Author::deleteAll(array('conditions' => array('parent_author_id = ?', 2), 'limit' => 1, 'order' => 'name asc'));
$this->assertEquals(1, $numAffected);
$this->assertTrue(strpos(Author::table()->lastSql, 'ORDER BY name asc LIMIT 1') !== false);
}
示例15: test_author_deleteAll
function test_author_deleteAll()
{
//Arrange
$id = 1;
$author_name = "Whitman";
$test_author = new Author($author_name, $id);
$test_author->save();
$id2 = 2;
$author_name2 = "Twain";
$test_author2 = new Author($author_name2, $id2);
$test_author2->save();
//Act
Author::deleteAll();
//Assert
$result = Author::getAll();
$this->assertEquals([], $result);
}