Closed LaurentEsc closed 9 years ago
Moving the HoneypotFacade
to another namespace is a breaking change, probably not the best idea ...
To be honest I think at this point it would make sense to just get rid of the HoneypotValidator.php
and move those 3 functions into Honeypot.php
and update the tests. That way there isn't a need for two facades which seems overcomplicated imo.
Also I think I would prefer to see something like Honeypot::enable()
and Honeypot::disable()
as oppose to the suggestion of mocking the validator functions.
Something like this ? I also like Honeypot::disable()
for testing.
Looks good to me. Tests pass?
Once updated I would suggest to squash the commits.
The problem with using Class@Method instead of a closure is that is creates a new instance to validate, so disable() doesn't work.
Gotcha. I'm pretty sure the validator resolves the class thru the IOC so in theory if you did honeypot@method
it should work.
Indeed, seems to work.
Tests didn't pass after I cloned:
1) Msurguy\Tests\HoneypotTest::test_get_honeypot_form_html BadMethodCallException: Method Mockery_0_Msurguy_Honeypot_Honeypot::getFormHTML() does not exist on this mock object
It should be generate
, tests prob has been failing on that for a while.
Documentation updated and commits squashed.
Looks good. :+1:
This PR is related to issue #39 and is a suggestion to allow easy Validator mocking:
I have updated the documentation.