function _functions($object) { return Underscore::functions($object); }
/** * @tags objects */ public function testFunctions() { // it should extract function names from lists $list = ['prop' => 1, 'foo' => function () { }, 'bar' => function () { }, 'baz' => function () { }]; $this->array(_::functions($list))->isEqualTo(['foo', 'bar', 'baz']); $this->array(_::functions((object) $list))->isEqualTo(['foo', 'bar', 'baz']); // it should extract function names from classes $this->array(_::functions("\\SomeClass"))->isEqualTo(['foo', 'bar', 'baz']); // it should extract function names from instances $object = new \SomeClass(); $this->array(_::functions($object))->isEqualTo(['foo', 'bar', 'baz']); }