コード例 #1
0
 /**
  * @dataProvider provideFunctorTestData
  */
 public function test_it_should_obey_functor_laws(callable $f, callable $g, Functor $x)
 {
     FunctorLaws::test(f\curryN(3, [$this, 'assertEquals']), $f, $g, $x);
 }
コード例 #2
0
 /**
  * @dataProvider provideFunctorTestData
  */
 public function test_it_should_obey_functor_laws(callable $f, callable $g, Functor $x, $reader)
 {
     FunctorLaws::test(function (Reader $a, Reader $b, $message) use($reader) {
         $this->assertEquals($a->runReader($reader), $b->runReader($reader), $message);
     }, $f, $g, $x);
 }
コード例 #3
0
 /**
  * @dataProvider provideFunctorTestData
  */
 public function test_it_should_obey_functor_laws(callable $f, callable $g, Functor $x)
 {
     FunctorLaws::test(function (Writer $a, Writer $b, $message) {
         $this->assertEquals($a->runWriter(), $b->runWriter(), $message);
     }, $f, $g, $x);
 }
コード例 #4
0
 /**
  * @dataProvider provideFunctorTestData
  */
 public function test_it_should_obey_functor_laws(callable $f, callable $g, Functor $x, $state)
 {
     FunctorLaws::test(function (State $a, State $b, $message) use($state) {
         $this->assertEquals($a->runState($state), $b->runState($state), $message);
     }, $f, $g, $x);
 }