public function testHasPrecurriedVersion() { $join = function ($a, $b) { return "{$a} {$b}"; }; $data = ['name' => ['first' => 'James', 'last' => 'Bond'], 'code' => '007', 'country' => 'UK']; $this->assertSame('James Bond 007', call_user_func(call_user_func(F\C1\converge($join), [F\compose(F\curry('implode', ' '), 'array_values', F\C2\propOr('', 'name')), F\C2\propOr('', 'code')]), $data)); }
public function testSomeText() { $exclaim = function ($x) { return "{$x}!"; }; $shout = F\compose($exclaim, 'strtoupper'); $this->assertSame('Y U NO COMPOSE!', $shout('y u no compose')); }