Exemplo n.º 1
0
 function testDelete()
 {
     $book_id = 1;
     $test_copy = new Copy($book_id);
     $test_copy->save();
     $book_id2 = 2;
     $test_copy2 = new Copy($book_id2);
     $test_copy2->save();
     $test_copy->delete();
     $this->assertEquals([$test_copy2], Copy::getAll());
 }
Exemplo n.º 2
0
 function test_delete()
 {
     //Arrange
     $book_id = 2;
     $test_copy = new Copy($book_id);
     $test_copy->save();
     //Act
     $test_copy->delete();
     $result = Copy::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 3
0
 function test_delete()
 {
     //Arrange
     $available = true;
     $book_id = 4;
     $test_copy = new Copy($available, $book_id);
     $test_copy->save();
     $available2 = true;
     $book_id2 = 5;
     $test_copy2 = new Copy($available2, $book_id2);
     $test_copy2->save();
     //Act
     $test_copy->delete();
     $result = Copy::getAll();
     //Assert
     $this->assertEquals([$test_copy2], $result);
 }