protected function tearDown() { Checkout::deleteAll(); Book::deleteAll(); Author::deleteAll(); Patron::deleteAll(); }
protected function tearDown() { Author::deleteAll(); Book::deleteAll(); Patron::deleteAll(); Copies::deleteAll(); }
protected function tearDown() { Book::deleteAll(); Copy::deleteAll(); Author::deleteAll(); Patron::deleteAll(); }
protected function tearDown() { Book::deleteAll(); Author::deleteAll(); $GLOBALS['DB']->exec("DELETE FROM authors_books;"); $GLOBALS['DB']->exec("DELETE FROM copies;"); }
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); }
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); }
function test_deleteAll() { //Arrange $name = "Ashlin Aronin"; $test_author = new Author($name); $test_author->save(); $name2 = "Vincent Adultman"; $test_author2 = new Author($name2); $test_author2->save(); //Act Author::deleteAll(); //Assert $result = Author::getAll(); $this->assertEquals([], $result); }
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); }
function test_deleteAll() { //Arrange $name = "J.K. Rowling"; $test_author = new Author($name); $test_author->save(); $name2 = "C.S. Lewis"; $test_author2 = new Author($name2); $test_author2->save(); //Act Author::deleteAll(); //Assert $result = Author::getAll(); $this->assertEquals([], $result); }
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); }
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); }
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); }
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); }
$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;
protected function tearDown() { Book::deleteAll(); Author::deleteAll(); BookList::deleteAll(); }
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); }
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); }
function test_deleteAll() { //Arrange $name = "James Patterson"; $id = 1; $name2 = "Stephen King"; $id2 = 2; $test_author = new Author($name, $id); $test_author->save(); $test_course2 = new Author($name2, 2, $id2); $test_course2->save(); //Act Author::deleteAll(); $result = Author::getAll(); //Assert $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $first_name = "J.K."; $last_name = "Rowling"; $test_author = new Author($first_name, $last_name); $test_author->save(); $first_name2 = "John"; $last_name2 = "Steinbeck"; $test_author2 = new Author($first_name2, $last_name2); $test_author2->save(); //Act Author::deleteAll(); //Assert $result = Author::getAll(); $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $author_name = "J.K. Rowling"; $id = 1; $test_author = new Author($author_name, $id); $test_author->save(); $author_name2 = "John Steinbeck"; $id2 = 2; $test_author2 = new Author($author_name2, $id2); $test_author2->save(); //Act Author::deleteAll(); //Assert $result = Author::getAll(); $this->assertEquals([], $result); }
function test_deleteAll() { //Arrange $name = "David Foster Wallace"; $test_author = new Author($name); $test_author->save(); $name2 = "Stephen King"; $test_author2 = new Author($name2); $test_author2->save(); //Act Author::deleteAll(); $result = Author::getAll(); //Assert $this->assertEquals([], $result); }
protected function tearDown() { Author::deleteAll(); }
function testDeleteAll() { //Arrange $author_first = "J.K."; $author_last = "Rowling"; $test_author = new Author($author_first, $author_last); $test_author->save(); $author_first2 = "John"; $author_last2 = "Steinbeck"; $test_author2 = new Author($author_first2, $author_last2); $test_author2->save(); //Act Author::deleteAll(); //Assert $result = Author::getAll(); $this->assertEquals([], $result); }
protected function tearDown() { //It doesn't like Book::deleteAll(), and there is nothing linking to Author. Book::deleteAll(); Author::deleteAll(); }
function test_deleteAll() { $name = "Dad"; $id = 1; $test_author1 = new Author($name, $id); $test_author1->save(); $name2 = "Uncle Ben"; $id2 = 2; $test_author2 = new Author($name2, $id2); $test_author2->save(); Author::deleteAll(); $result = Author::getAll(); $this->assertEquals([], $result); }
/** * testCreationOfEmptyRecord method * * @return void */ public function testCreationOfEmptyRecord() { $this->loadFixtures('Author'); $TestModel = new Author(); $this->assertEquals(4, $TestModel->find('count')); $TestModel->deleteAll(true, false, false); $this->assertEquals(0, $TestModel->find('count')); $result = $TestModel->save(); $this->assertTrue(isset($result['Author']['created'])); $this->assertTrue(isset($result['Author']['updated'])); $this->assertEquals(1, $TestModel->find('count')); }
function test_deleteAll() { //Arrange $author_name = "Jack London"; $test_author = new Author($author_name); $test_author->save(); $author_name2 = "Robert Jordan"; $test_author2 = new Author($author_name2); $test_author2->save(); //Act Author::deleteAll(); $result = Author::getAll(); //Assert $this->assertEquals([], $result); }