Last active
August 29, 2015 14:01
-
-
Save shadowhand/2b16cc44cc03ca5a1039 to your computer and use it in GitHub Desktop.
Testing side effects with phpspec
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you wanted to continue with your design, you'd have to do sth like:
However, I think it shouldn't be possible to create a
Tag
instance without a slug. It's simply an invalid object. Object shouldn't be put in an invalid state. So, it's construction should look more like:The slug should be generated even before the
Tag
is created.