public function testMixin() { // from js __u::mixin(array('myReverse' => function ($string) { $chars = str_split($string); krsort($chars); return join('', $chars); })); $this->assertEquals('aecanap', __u::myReverse('panacea'), 'mixed in a function to _'); $this->assertEquals('pmahc', __u('champ')->myReverse(), 'mixed in a function to _ with OO-style call'); // docs __u::mixin(array('capitalize' => function ($string) { return ucwords($string); }, 'yell' => function ($string) { return strtoupper($string); })); $this->assertEquals('Moe', __u::capitalize('moe')); $this->assertEquals('MOE', __u::yell('moe')); }