mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #5123 from cakephp/issue-4993
Remove singularization on schema class names
This commit is contained in:
commit
b5eb51deee
2 changed files with 11 additions and 11 deletions
|
@ -89,7 +89,7 @@ class SchemaShell extends AppShell {
|
|||
$name = $plugin;
|
||||
}
|
||||
}
|
||||
$name = Inflector::classify($name);
|
||||
$name = Inflector::camelize($name);
|
||||
$this->Schema = new CakeSchema(compact('name', 'path', 'file', 'connection', 'plugin'));
|
||||
}
|
||||
|
||||
|
@ -292,10 +292,10 @@ class SchemaShell extends AppShell {
|
|||
$Schema = $this->Schema->load($options);
|
||||
|
||||
if (!$Schema) {
|
||||
$this->err(__d('cake_console', 'The chosen schema could not be loaded. Attempted to load:'));
|
||||
$this->err(__d('cake_console', 'File: %s', $this->Schema->path . DS . $this->Schema->file));
|
||||
$this->err(__d('cake_console', 'Name: %s', $this->Schema->name));
|
||||
return $this->_stop();
|
||||
$this->err(__d('cake_console', '<error>Error</error>: The chosen schema could not be loaded. Attempted to load:'));
|
||||
$this->err(__d('cake_console', '- file: %s', $this->Schema->path . DS . $this->Schema->file));
|
||||
$this->err(__d('cake_console', '- name: %s', $this->Schema->name));
|
||||
return $this->_stop(2);
|
||||
}
|
||||
$table = null;
|
||||
if (isset($this->args[1])) {
|
||||
|
|
|
@ -617,19 +617,19 @@ class SchemaShellTest extends CakeTestCase {
|
|||
$this->Shell->params = array(
|
||||
'plugin' => 'TestPlugin',
|
||||
'connection' => 'test',
|
||||
'name' => 'custom_name',
|
||||
'name' => 'custom_names',
|
||||
'force' => false,
|
||||
'overwrite' => true,
|
||||
);
|
||||
$this->Shell->startup();
|
||||
if (file_exists($this->Shell->Schema->path . DS . 'custom_name.php')) {
|
||||
unlink($this->Shell->Schema->path . DS . 'custom_name.php');
|
||||
if (file_exists($this->Shell->Schema->path . DS . 'custom_names.php')) {
|
||||
unlink($this->Shell->Schema->path . DS . 'custom_names.php');
|
||||
}
|
||||
$this->Shell->generate();
|
||||
|
||||
$contents = file_get_contents($this->Shell->Schema->path . DS . 'custom_name.php');
|
||||
$this->assertRegExp('/class CustomNameSchema/', $contents);
|
||||
unlink($this->Shell->Schema->path . DS . 'custom_name.php');
|
||||
$contents = file_get_contents($this->Shell->Schema->path . DS . 'custom_names.php');
|
||||
$this->assertRegExp('/class CustomNamesSchema/', $contents);
|
||||
unlink($this->Shell->Schema->path . DS . 'custom_names.php');
|
||||
CakePlugin::unload();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue