Creates a migration name from a table name
or keeps it intact if a migration name has already been set
public setMigrationName ( string $tableName ) : string | ||
$tableName | string | The original table name (Example: users, cats, create_users_table) |
return | string | The migration name |
/** * Test setMigrationName() * * @return void */ public function testSetMigrationName() { // Make sure table names are converted into their proper migration name $tableName = 'users'; $this->assertEquals($this->makeMigrationJson->setMigrationName($tableName), "create_{$tableName}_table"); // Make sure migration names are not converted $tableName = 'remove_city_from_users_table'; $this->assertEquals($this->makeMigrationJson->setMigrationName($tableName), $tableName); }