Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to regular order, enable random with flag #3

Closed
MPV opened this issue Mar 3, 2014 · 3 comments
Closed

Default to regular order, enable random with flag #3

MPV opened this issue Mar 3, 2014 · 3 comments

Comments

@MPV
Copy link
Contributor

MPV commented Mar 3, 2014

Just throwing an idea out:
What do you think about defaulting to regular order, and enabling random with a flag.

That way, people can use this package as a wrapper around phpunit, and run it in the same order as usual, and enable random order whenever you want to do that.

Again, with inspiration from RSpec, I suggest we use "--order rand":
https://relishapp.com/rspec/rspec-core/docs/command-line/order-new-in-rspec-core-2-8

@sjamaan
Copy link

sjamaan commented Aug 20, 2014

I think this would make more sense if phpunit integrated this functionality. Right now, phpunit-randomizer is an optional package, and if you're installing it it seems to me you want the randomizing behaviour. Expecting the user to add an extra flag after explicitly installing this package is counter-intuitive.

@fiunchinho
Copy link
Owner

The best solution would be to be integrated with PHPUnit, but I don't think that's going to happen any time soon.
I currently have a branch where this library behaves the same way as RSpec (as suggested in the issue), but not sure about merging.
One good thing about this is that users don't have to use two different binary files to run their tests (in case they sometimes want to use the default order). But on the other hand, it's right that feels weird that you choose to download a phpunit randomizer package, but you still have to specify a CLI argument to randomize it.

@fiunchinho
Copy link
Owner

I just released a new major version with this behaviour. Version 1.* keeps the old behaviour, but 2.* versions will act as PHPUnit by default, unless '--order rand' is specified. README has been updated to reflect these changes.

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

No branches or pull requests

3 participants