Skip to content

Commit

Permalink
Fixing capitalization in ControllerTask & test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 20, 2009
1 parent 943524b commit 37b5754
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cake/console/templates/default/actions/controller_actions.ctp
Expand Up @@ -128,13 +128,13 @@
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted', true));
$this->redirect(array('action'=>'index'));
<?php else: ?>
$this->flash(__('<?php echo strtolower($singularHumanName); ?> deleted', true), array('action' => 'index'));
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted', true), array('action' => 'index'));
<?php endif; ?>
}
<?php if ($wannaUseSession): ?>
$this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted', true));
<?php else: ?>
$this->flash(__('<?php echo strtolower($singularHumanName); ?> was not deleted', true), array('action' => 'index'));
$this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted', true), array('action' => 'index'));
<?php endif; ?>
$this->redirect(array('action' => 'index'));
}
10 changes: 5 additions & 5 deletions cake/tests/cases/console/libs/tasks/controller.test.php
Expand Up @@ -303,16 +303,16 @@ function testBakeActionsUsingSessions() {
$this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false);

$this->assertTrue(strpos($result, 'function view($id = null)') !== false);
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Invalid Article', true))") !== false);
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Invalid article', true))") !== false);
$this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false);

$this->assertTrue(strpos($result, 'function add()') !== false);
$this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false);
$this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false);
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The Article has been saved', true))") !== false);
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The article has been saved', true))") !== false);

$this->assertTrue(strpos($result, 'function edit($id = null)') !== false);
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The Article could not be saved. Please, try again.', true));") !== false);
$this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The article could not be saved. Please, try again.', true));") !== false);

$this->assertTrue(strpos($result, 'function delete($id = null)') !== false);
$this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false);
Expand Down Expand Up @@ -346,13 +346,13 @@ function testBakeActionsWithNoSessions() {
$this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false);

$this->assertTrue(strpos($result, 'function view($id = null)') !== false);
$this->assertTrue(strpos($result, "\$this->flash(__('Invalid Article', true), array('action' => 'index'))") !== false);
$this->assertTrue(strpos($result, "\$this->flash(__('Invalid article', true), array('action' => 'index'))") !== false);
$this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false);

$this->assertTrue(strpos($result, 'function add()') !== false);
$this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false);
$this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false);
$this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action' => 'index'))") !== false);
$this->assertTrue(strpos($result, "\$this->flash(__('The article has been saved.', true), array('action' => 'index'))") !== false);

$this->assertTrue(strpos($result, 'function edit($id = null)') !== false);
$this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false);
Expand Down

0 comments on commit 37b5754

Please sign in to comment.