Skip to content

Conversation

@josefsabl
Copy link
Contributor

No description provided.

@fprochazka
Copy link
Contributor

Do you think you could add a test case?

http://phpfashion.com/jak-komitovat-se-zarucni-smlouvou

@josefsabl
Copy link
Contributor Author

Hehe, I thought someone will probably ask.

Well, I had the test written before the fix. I actually am fan of TDD.

$h = Passwords::hash('dg', array('cost' => 31));
Assert::true(Passwords::verify('dg', $h));

It would verify that the bug is there in the first place.

But after some time of wondering why tests seem to not run at all, it turns out computers have hard time calculating hash with cost 31 and the test would never complete on my PC, so I just deleted it.

I think it's not worth the trouble for such a trivial thing.

@josefsabl
Copy link
Contributor Author

Anyway, I read that article by dg last week and use it to advocate unit testing in our company ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to use same magic numbers everywhere and use >= instead of > as it is less confusing and error prone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants