/** * Test that camelCase() returns strings as camel case. */ public function testCamelCase() { $camelCase = array('foo Bar', 'fOo Bar', 'foo_Bar', ' foo-_--_BAR', 'foo-BAR', 'FOO-BAR', 'foo bar '); foreach ($camelCase as $value) { $this->assertEquals('FooBar', Inflector::camelCase($value)); } }
function camel_case($string) { return Inflector::camelCase($string); }
/** * Check to see if a mutator method exists on the current model. * If so, return the method name, else return null. * * @param string $field * @return string */ public function hasMutator($field) { $method = sprintf('set%sAttribute', Inflector::camelCase($field)); if (method_exists($this, $method)) { return $method; } return null; }