public static function key($key, $data = array()) { return is_object($key) ? $key($data) : $key; }
public function testKeyWithClosureAndArguments() { $value = 'closure argument'; $key = function ($value) { return $value; }; $result = Cache::key($key($value)); $expected = 'closure argument'; $this->assertIdentical($expected, $result); }