public function testIdentity() { $id = Funktions::identity(); for ($i = 0; $i < 100; $i++) { $value = rand($i, $i * 100); $this->assertEquals($value, $id->apply($value)); } }
/** * Creates an identity functor. * * @return UnaryFunktionInterface */ function identity() : UnaryFunktionInterface { return Funktions::identity(); }