Example #1
0
 /**
  * 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));
     }
 }
Example #2
0
 function camel_case($string)
 {
     return Inflector::camelCase($string);
 }
Example #3
0
 /**
  * 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;
 }