Skip to content

Commit c9eb13c

Browse files
committed
Updated documentation to new parameter name
1 parent 5ec05b1 commit c9eb13c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ phpunit-randomizer
44
A PHPUnit extension that allows you to execute your test cases in a random order. This way you can identify tests that depend on other tests because they share some state, like object state, or even database state.
55
PHPUnit has an option to execute test cases in process isolation, but that takes a lot of time when you have many tests.
66

7-
With this library, you don't have to modify any PHPUnit code. Just install it, and use the executable to run your tests, instead of using the default phpunit command.
7+
With this library, you don't have to modify any PHPUnit code. Just install it, and use the binary from the vendor folder (vendor/fiunchinho/phpunit-randomizer/bin/phpunit-randomizer) to run your tests, instead of using the default phpunit command.
88

99

1010
Installing Dependencies
@@ -17,21 +17,27 @@ $> php composer.phar install
1717

1818
Usage
1919
-------
20-
The executable binary is under the bin folder and it works exactly the same as the default phpunit file, accepting the same arguments, except for one: The `seed` argument.
20+
The executable binary is under the bin folder and it works exactly the same as the default phpunit file, accepting the same arguments, except for one: The `order` argument.
2121

2222
```bash
2323
$> bin/phpunit-randomizer -h
2424
```
2525

26-
When you execute your tests using this library, if you look to the output, you'll see that it says that the tests have been randomized using a random seed. If you don't specify any seed, the seed will be calculated randomly, every time you execute your tests. But if you want to repeat an specific order that is interesting to you (because it failed, for example), you can re-run that order specifing the seed argument.
26+
When you execute your tests using this library, you will get the same results as using a regular PHPUnit installation unless you use the `--order rand` parameter. Try executing the following:
2727

28-
For example, let's try to execute the example tests twice, and see how the order differ.
28+
```bash
29+
$> bin/phpunit-randomizer --order rand
30+
```
31+
32+
If you look to the output, you'll see that it says that the tests have been randomized using a random seed. If you don't specify any seed (like the example above), the seed will be calculated randomly every time you execute your tests. But if you want to repeat an specific order that is interesting to you (because it failed, for example), you can re-run that order specifing the seed in your `order` argument.
33+
34+
For example, let's try to execute the example tests (that print the name of the test case so we can see the order in which they are executed) twice, and see how the order differ.
2935

30-
![Executing randomly your tests](http://i.imgur.com/zXVc11R.png)
36+
![Executing randomly your tests](http://i.imgur.com/CM3RoQz.png)
3137

32-
Here you can see how the order of the test cases is different in the two executions. Also, you can see the seed used in both cases (604 in the first one, 295 in the second). Now, if we want to repeat the order of the second execution, we can select the same seed.
38+
Here you can see how the order of the test cases is different in the two executions. Also, you can see the seed used in both cases (8639 in the first one, 4674 in the second). Now, if we want to repeat the order of the second execution, we can select the same seed.
3339

34-
![Executing randomly your tests](http://i.imgur.com/bGk33g1.png)
40+
![Executing randomly your tests](http://i.imgur.com/uTWtspK.png)
3541

3642
As you can see, the order is exactly the same.
3743

0 commit comments

Comments
 (0)