fiunchinho / phpunit-randomizer Goto Github PK
View Code? Open in Web Editor NEWA PHPUnit extension that allows you to execute your test cases in a random order
License: MIT License
A PHPUnit extension that allows you to execute your test cases in a random order
License: MIT License
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
Hi,
Awesome extension of phpunit!
It works like a charm.
What you think about adding functionality for being able to run the same randomized order (seed) again?
To compare, here's the equivalent feature in RSpec:
https://relishapp.com/rspec/rspec-core/docs/command-line/order-new-in-rspec-core-2-8
We need to start using semantical versioning and register the project in packagist.
PHP Fatal error: Uncaught Declaration of PHPUnitRandomizer\TestRunner::doRun(PHPUnit_Framework_Test $suite, array $arguments = Array) should be compatible with PHPUnit_TextUI_TestRunner::doRun(PHPUnit_Framework_Test $suite, array $arguments, $exit)
XX/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:57
XX/vendor/fiunchinho/phpunit-randomizer/src/PHPUnitRandomizer/TestRunner.php:4
XX/vendor/fiunchinho/phpunit-randomizer/src/PHPUnitRandomizer/Command.php:56
XX/vendor/fiunchinho/phpunit-randomizer/src/PHPUnitRandomizer/Command.php:13thrown in XX/vendor/fiunchinho/phpunit-randomizer/src/PHPUnitRandomizer/TestRunner.php on line 4
The annotation @Depends is not taken into account while it's necessary to run my tests.
You cannot execute a test B which depends on a test A before the test A.
It is possible to fix that behavior or is it intentional ?
For some reason, PHPUnit is not executing setUpBeforeClass and tearDownAfterClass when using the randomizer.
This is really important, because many tests that rely on these methods will fail.
Please consider adding a license to this package. ATM it is unclear how this package may be used.
For everybody that finds this repo and wants to try it out: you don't need this.
You can run the following:
vendor/bin/phpunit --order-by=random
To the author: It would be great if you could change the readme of this project to say it's not needed anymore, because PHPUnit has an --order-by=random
feature.
Best,
Ruud
Looking at the composer file, it seems that phpunit-randomizer is tied to version 4.2 of PHPUnit.
Can we safely raise the required version or there is a reason behind that?
As you might know, PHPUnit started to release new versions more frequently, so it would be great if we can use the latest version of it
Getting an error while running
vendor/bin/phpunit-randomizer --order rand
PHPUnit 7.4.3 by Sebastian Bergmann and contributors.
option --order is ambiguous
Any idea?
PHPUnit 6.0 has been released.
One of the large changes is that classes do not use the _
namespace separator, but rather the PSR \
namespace separator. (See https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-6.0.md).
This breaks the usages of PHPUnit-randomizer where the old classes are imported. Would you accept a PR which uses the new classes, and release a new version of your randomizer? Most of the namespaced classes are in use since somewhere around PHPUnit 5.4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.