/** * (as) */ public function name($name) { $single = explode(' ', strtolower(Inflector::humanize($name))); $plural = $single; $count = count($single); $single[$count - 1] = Inflector::singularize($single[$count - 1]); $plural[$count - 1] = Inflector::pluralize($plural[$count - 1]); $this->name = array(implode('_', $single), implode('_', $plural)); return $this; }
public function testHumanize() { foreach (self::$underscore_to_human as $underscore => $human) { $this->assertEquals($human, Inflector::humanize($underscore)); } }