public static function snakeToCamelCase($input) { if (!is_string($input)) { return null; } $output = preg_replace_callback('/(^|_)+(.)/', function ($match) { return strtoupper($match[2]); }, $input); return lcfirst($output); }
/** * Test that constructor args were pulled properly * * Note that we need to deuplicate the CamelCase conversion here for old * fashioned classes */ public function testInitConstructorArgs() { $expectedConstructorArgs = array(); foreach ($this->getConstructorArgs() as $param) { $expectedConstructorArgs[Util::snakeToCamelCase($param->getName())] = $param; } $this->assertEquals($expectedConstructorArgs, $this->resolver->getConstructorArgs()); }