mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Add stricter validation to TestTask.
Empty classnames, and classnames without the correct type suffix are no longer accepted. They did the wrong thing anyways. Fixes #2267
This commit is contained in:
parent
9c5ad71abc
commit
8981f49bd5
1 changed files with 8 additions and 6 deletions
|
@ -205,12 +205,14 @@ class TestTask extends BakeTask {
|
||||||
$this->out(++$key . '. ' . $option);
|
$this->out(++$key . '. ' . $option);
|
||||||
$keys[] = $key;
|
$keys[] = $key;
|
||||||
}
|
}
|
||||||
$selection = $this->in(__d('cake_console', 'Choose an existing class, or enter the name of a class that does not exist'));
|
while (empty($selection)) {
|
||||||
if (isset($options[$selection - 1])) {
|
$selection = $this->in(__d('cake_console', 'Choose an existing class, or enter the name of a class that does not exist'));
|
||||||
$selection = $options[$selection - 1];
|
if (is_numeric($selection) && isset($options[$selection - 1])) {
|
||||||
}
|
$selection = $options[$selection - 1];
|
||||||
if ($type !== 'Model') {
|
}
|
||||||
$selection = substr($selection, 0, $typeLength * - 1);
|
if ($type !== 'Model') {
|
||||||
|
$selection = substr($selection, 0, $typeLength * - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $selection;
|
return $selection;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue