php-quickcheck
php-quickcheck copied to clipboard
generative testing for PHP
I quickly hacked up this to support testing my class that uses DateTime's extensively. Could it be of interest to others? The function can of course just be copy-pasted straight...
Since the initial port test.check has changed the RNG from java.util.Random to an immutable version of java.util.SplittableRandom. https://github.com/clojure/test.check/blob/000000076395383d824ec8a468a88ee2baa6f121/src/main/clojure/clojure/test/check/random.clj
This will improve shrinking performance for examples like the one given in #14. See https://github.com/clojure/test.check/commit/1f1e4fcffd099201e849fc24e9b8d1f79d035bc8
It would be lovely to have something like `gen/vector-distinct`, only for our trusty PHP arrays.
Since the initial port test.check has gained a generator for floating point values. It would be great to have this available in PHPQuickCheck as well. See https://github.com/clojure/test.check/blob/000000076395383d824ec8a468a88ee2baa6f121/src/main/clojure/clojure/test/check/generators.cljc#L1069
Using this, you can easily use generators as providers like it is done in the tests : ``` function provider($name, $n = 10) { return DataProvider::provider(array( Generator::strings(), Generator::ints(), Generator::booleans() ),...