protected function tearDown() { Book::deleteAll(); Copy::deleteAll(); Author::deleteAll(); Patron::deleteAll(); }
function testDeleteAll() { $title = "Three Blind Mice"; $test_book = new Book($title); $test_book->save(); $amount = 3; $book_id = $test_book->getId(); $test_copy = new Copy($amount, $book_id); $test_copy->save(); Copy::deleteAll(); $result = Copy::getAll(); $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $book_id = 1; $test_copy = new Copy($book_id); $test_copy->save(); $book_id2 = 2; $test_copy2 = new Copy($book_id2); $test_copy2->save(); //Act Copy::deleteAll(); $result = Copy::getAll(); //Assert $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $due_date = '2015-10-10'; $book_id = 1; $id = 1; $test_copy = new Copy($due_date, $book_id, $id); $test_copy->save(); $due_date2 = '2015-11-11'; $book_id2 = 2; $id2 = 2; $test_copy2 = new Copy($due_date2, $book_id2, $id2); $test_copy2->save(); //Act Copy::deleteAll(); $result = Copy::getAll(); //Assert $this->assertEquals([], $result); }
protected function tearDown() { Patron::deleteAll(); Copy::deleteAll(); Checkout::deleteAll(); }
protected function tearDown() { Copy::deleteAll(); Book::deleteAll(); Checkout::deleteAll(); }
protected function tearDown() { Book::deleteAll(); Copy::deleteAll(); }
protected function tearDown() { Copy::deleteAll(); Book::deleteAll(); Patron::deleteAll(); }
function test_deleteAll() { //Arrange $available = true; $book_id = 4; $test_copy = new Copy($available, $book_id); $test_copy->save(); //Act $test_copy->deleteAll(); $result = Copy::getAll(); //Assert $this->assertEquals([], $result); }