/** * Split the string at each occurrence of a camel * case, add underscores to separate individual * words and pluralize the word to agree with * the database schema * * @return mixed */ public function getTable() { if (!isset(self::$tableName)) { $splitter = new Splitter(static::getClassName()); $splittedString = $splitter->format(); self::$tableName = Inflect::pluralize($splittedString); } return self::$tableName; }
/** * @param $expected * @param $actual * * @dataProvider wordProvider */ public function testWordInflection($actual, $expected) { $this->assertEquals($expected, Inflect::pluralize($actual)); }