mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #1445 from Phally/master-3895-2
Fixes cake bake all. Refs #1443.
This commit is contained in:
commit
1b3b4e6508
2 changed files with 9 additions and 3 deletions
|
@ -328,6 +328,11 @@ class ControllerTask extends BakeTask {
|
||||||
'plugin' => $this->plugin,
|
'plugin' => $this->plugin,
|
||||||
'pluginPath' => empty($this->plugin) ? '' : $this->plugin . '.'
|
'pluginPath' => empty($this->plugin) ? '' : $this->plugin . '.'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
if (!in_array('Paginator', (array)$components)) {
|
||||||
|
$components[] = 'Paginator';
|
||||||
|
}
|
||||||
|
|
||||||
$this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold'));
|
$this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold'));
|
||||||
$contents = $this->Template->generate('classes', 'controller');
|
$contents = $this->Template->generate('classes', 'controller');
|
||||||
|
|
||||||
|
|
|
@ -286,8 +286,9 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
$this->assertContains(' * @property Article $Article', $result);
|
$this->assertContains(' * @property Article $Article', $result);
|
||||||
$this->assertContains(' * @property AclComponent $Acl', $result);
|
$this->assertContains(' * @property AclComponent $Acl', $result);
|
||||||
$this->assertContains(' * @property AuthComponent $Auth', $result);
|
$this->assertContains(' * @property AuthComponent $Auth', $result);
|
||||||
|
$this->assertContains(' * @property PaginatorComponent $Paginator', $result);
|
||||||
$this->assertContains('class ArticlesController extends AppController', $result);
|
$this->assertContains('class ArticlesController extends AppController', $result);
|
||||||
$this->assertContains("public \$components = array('Acl', 'Auth')", $result);
|
$this->assertContains("public \$components = array('Acl', 'Auth', 'Paginator')", $result);
|
||||||
$this->assertContains("public \$helpers = array('Js', 'Time')", $result);
|
$this->assertContains("public \$helpers = array('Js', 'Time')", $result);
|
||||||
$this->assertContains("--actions--", $result);
|
$this->assertContains("--actions--", $result);
|
||||||
|
|
||||||
|
@ -300,8 +301,8 @@ class ControllerTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Task->bake('Articles', '--actions--', array(), array());
|
$result = $this->Task->bake('Articles', '--actions--', array(), array());
|
||||||
$this->assertContains('class ArticlesController extends AppController', $result);
|
$this->assertContains('class ArticlesController extends AppController', $result);
|
||||||
$this->assertSame(substr_count($result, '@property'), 1);
|
$this->assertSame(substr_count($result, '@property'), 2);
|
||||||
$this->assertNotContains('components', $result);
|
$this->assertContains("public \$components = array('Paginator')", $result);
|
||||||
$this->assertNotContains('helpers', $result);
|
$this->assertNotContains('helpers', $result);
|
||||||
$this->assertContains('--actions--', $result);
|
$this->assertContains('--actions--', $result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue