function testUpdate() { //Arrange $due_date = '2015-10-10'; $book_id = 1; $id = 1; $test_copy = new Copy($due_date, $book_id, $id); $test_copy->save(); $new_due_date = '2015-11-11'; //Act $test_copy->update($new_due_date); //Assert $this->assertEquals('2015-11-11', $test_copy->getDueDate()); }
function testUpdate() { $book_title = "Snow Crash"; $id = null; $test_book = new Book($book_title, $id); $test_book->save(); $test_copy = new Copy($amount = 1, $test_book->getId()); $test_copy->save(); $new_amount = $amount + 1; $test_copy->update($new_amount); $this->assertEquals(2, $test_copy->getAmount()); }