public function testIsFunction() { // from js $func = function () { }; $this->assertFalse(__u::isFunction(array(1, 2, 3)), 'arrays are not functions'); $this->assertFalse(__u::isFunction('moe'), 'strings are not functions'); $this->assertTrue(__u::isFunction($func), 'but functions are'); // extra $this->assertFalse(__u::isFunction('array_search'), 'strings with names of functions are not functions'); $this->assertFalse(__u::isFunction(new __u())); $this->assertFalse(__u(array(1, 2, 3))->isFunction()); $this->assertFalse(__u('moe')->isFunction()); $this->assertTrue(__u($func)->isFunction()); $this->assertFalse(__u('array_search')->isFunction()); $this->assertFalse(__u(new __u())->isFunction()); // docs $this->assertTrue(__u::isFunction(function () { })); $this->assertFalse(__u::isFunction('trim')); }