Update readme
authorwidmogrod <widmogrod@gmail.com>
Wed, 13 Dec 2017 00:21:32 +0000 (01:21 +0100)
committerwidmogrod <widmogrod@gmail.com>
Wed, 13 Dec 2017 00:21:32 +0000 (01:21 +0100)
README.md
example/Free2BddStyleDSLTest.php
test/Primitive/ListtTest.php
test/Primitive/NumTest.php
test/Primitive/ProductTest.php
test/Primitive/StringgTest.php
test/Primitive/SumTest.php

index 0682681..cf92a70 100644 (file)
--- a/README.md
+++ b/README.md
@@ -244,14 +244,13 @@ Free monad enables you to do exactly that, and more:
 
 #### Echo program
 Example Free Monad example of `echo program` can be found here:
-- [FreeMonadTest.php](/example/FreeMonadTest.php) - example based on first implementation of Free
-- [Free2MonadTest.php](/example/Free2MonadTest.php) - example based on second implementation of Free, based on [Haskell implementation](https://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Free-Class.html)
+- See source code [FreeMonadTest.php](/example/FreeMonadTest.php) - example based on first implementation of Free
+- See source code [Free2MonadTest.php](/example/Free2MonadTest.php) - example based on second implementation of Free, based on [Haskell implementation](https://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Free-Class.html)
 
 #### DSL for `BDD` tests
 Example that use `Free Monad` to creates simple DSL (Domain Specific Language) to define BDD type of framework: 
 
-- [Free2BddStyleDSLTest.php](/example/Free2BddStyleDSLTest.php) - example based on second implementation of Free, based on [Haskell implementation](https://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Free-Class.html)
-
+- See source code [Free2BddStyleDSLTest.php](/example/Free2BddStyleDSLTest.php) 
 ```php
 $state = [
     'productsCount' => 0,
index c1507c2..b28bd15 100644 (file)
@@ -232,6 +232,9 @@ function matchRegexp(array $patterns, $value = null)
     }), func_get_args());
 }
 
+/**
+ * Inspired by https://github.com/politrons/TestDSL
+ */
 class Free2BddStyleDSLTest extends \PHPUnit_Framework_TestCase
 {
     public function test_it_should_interpret_bdd_scenario()
index e428f40..7f5c7c6 100644 (file)
@@ -136,7 +136,7 @@ class ListtTest extends \PHPUnit_Framework_TestCase
 
     private function randomize()
     {
-        return Listt::of(array_keys(array_fill(0, rand(20, 100), null)));
+        return Listt::of(array_keys(array_fill(0, random_int(20, 100), null)));
     }
 
     public function provideRandomizedData()
index 9e1b948..010d3d8 100644 (file)
@@ -26,7 +26,7 @@ class NumTest extends \PHPUnit_Framework_TestCase
 
     private function randomize()
     {
-        return Num::of(rand(-100000000, 100000000));
+        return Num::of(random_int(-100000000, 100000000));
     }
 
     public function provideSetoidLaws()
index fa25eb6..d5310a5 100644 (file)
@@ -43,7 +43,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase
 
     private function randomize()
     {
-        return Product::of(rand(-100000000, 100000000));
+        return Product::of(random_int(-100000000, 100000000));
     }
 
     public function provideSetoidLaws()
index e6c65e7..f2d9e8e 100644 (file)
@@ -24,7 +24,7 @@ class StringgTest extends \PHPUnit_Framework_TestCase
 
     private function randomize()
     {
-        return Stringg::of(md5(rand(0, 100)));
+        return Stringg::of(md5(random_int(0, 100)));
     }
 
     public function provideRandomizedData()
index 3e2d41b..50a8893 100644 (file)
@@ -43,7 +43,7 @@ class SumTest extends \PHPUnit_Framework_TestCase
 
     private function randomize()
     {
-        return Sum::of(rand(-100000000, 100000000));
+        return Sum::of(random_int(-100000000, 100000000));
     }
 
     public function provideSetoidLaws()