/** * 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 nameProvider */ public function testClassNameIsSplitted($expected, $actual) { $splitter = new Splitter($actual); $this->assertEquals($expected, $splitter->format()); }