Example #1
0
 function testDeleteAuthor()
 {
     //Arrange
     $author_name = "Plato";
     $id = 1;
     $test_author = new Author($author_name, $id);
     $test_author->save();
     $author_name2 = "Stephen King";
     $id2 = 2;
     $test_author2 = new Author($author_name, $id2);
     $test_author2->save();
     //Act
     $test_author->deleteOne();
     //Assert
     $this->assertEquals([$test_author2], Author::getAll());
 }
Example #2
0
 function testDeleteOne()
 {
     //Arrange
     //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
     $test_author->deleteOne();
     //Assert
     $this->assertEquals([$test_author2], Author::getAll());
 }
 function testDeleteOne()
 {
     //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
     $test_author->deleteOne();
     //Assert
     $this->assertEquals([$test_author2], Author::getAll());
 }
Example #4
0
 function testDeleteOne()
 {
     //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
     $test_author->deleteOne();
     //Assert
     $this->assertEquals([$test_author2], Author::getAll());
 }
Example #5
0
 function testDeleteOne()
 {
     $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();
     $test_author2->deleteOne();
     $result = Author::getAll();
     $this->assertEquals([$test_author], $result);
 }