Giter Club home page Giter Club logo

Comments (4)

pimjansen avatar pimjansen commented on September 25, 2024 1

Closing this since we updated the seeding used in setup. If changes are still required feel free to raise a pr fornthis

from faker.

IonBazan avatar IonBazan commented on September 25, 2024

Good point - I've noticed some inconsistency there too. What do you think about putting it in setUp() method in \Faker\Test\TestCase and making sure all tests are extending this class? That would reduce code duplication for:

$this->faker = new Generator();
$this->faker->seed(1);

While we are here, we could replace the second argument for mt_srand to MT_RAND_MT19937 as we already require PHP 7.1 so no need to keep the compatibility with previous versions:

public function seed($seed = null)
{
if ($seed === null) {
mt_srand();
} else {
mt_srand((int) $seed, MT_RAND_PHP);
}
}

But that would be a breaking change.

from faker.

pimjansen avatar pimjansen commented on September 25, 2024

Agree on the default seed set in the setup. The MTRand for now is fine. Lets bump that in 2.x

from faker.

krsriq avatar krsriq commented on September 25, 2024

The downside of seeding the random number generator for all tests would of course be that our tests would miss cases that only occur sometimes/randomly.

from faker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.