You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. In our phpunit test we use srand to set initial value for the random number generator. After we started to use softmocks we've encountered the problem which was inequality between expected and actual results in tests which cover a code which uses the mt_rand function.
The reason was that during creation of mock cache the PrettyPrinterAbstract is called and mt_rand ran. It would be better to think not to use mt_rand.
The text was updated successfully, but these errors were encountered:
I do agree that this code looks a bit odd but I suggest that you create a github issue in PHP Parser repository as in this case it may be a source of very subtle bugs too.
Hi. In our phpunit test we use srand to set initial value for the random number generator. After we started to use softmocks we've encountered the problem which was inequality between expected and actual results in tests which cover a code which uses the mt_rand function.
The reason was that during creation of mock cache the PrettyPrinterAbstract is called and mt_rand ran. It would be better to think not to use mt_rand.
The text was updated successfully, but these errors were encountered: