public function testConsume()
 {
     $consumer = NaryConsumer::create(self::getCallable());
     $a = rand(1, 100);
     $b = rand(1, 100);
     $c = rand(1, 100);
     $d = rand(1, 100);
     ob_start();
     $consumer->consume($a, $b, $c, $d);
     $result = trim(ob_get_clean());
     $this->assertEquals("" . ($a + $b) * ($c + $d), $result);
 }
Beispiel #2
0
 /**
  *
  * @param callable $consumer
  * @return NaryConsumerInterface
  */
 public static final function newNaryConsumer(callable $consumer) : NaryConsumerInterface
 {
     return NaryConsumer::create($consumer);
 }