public function testConsume()
 {
     $consumer = UnaryConsumer::create(self::getCallable());
     $a = rand(1, 100);
     ob_start();
     $consumer->consume($a);
     $result = trim(ob_get_clean());
     $this->assertEquals("{$a}", $result);
 }
Example #2
0
 /**
  *
  * @param callable $consumer
  * @return UnaryConsumerInterface
  */
 public static final function newUnaryConsumer(callable $consumer) : UnaryConsumerInterface
 {
     return UnaryConsumer::create($consumer);
 }