JeffreyWay / Laravel-Testing-Decoded

This project is exclusively for reporting typos and errors in the book, "Laravel Testing Decoded."
34 stars 10 forks source link

Page 111 (PDF) Tests differ after refactoring #96

Open assertchris opened 10 years ago

assertchris commented 10 years ago

Small point, but it was initially confusing to me. The refactored app/tests/models/AuthorTest.php code (page 111, PDF) differs, in what it tests for, from the original code (page 107, PDF).

The original testIsInvalidWithoutAValidEmail() method tests not for the presence of the email value but rather the validity of the email address format. While the refactored code is not semantically incorrect; it doesn't test the same thing.