Skip to content

Commit

Permalink
Fixing unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmemmesheimer committed Aug 19, 2015
1 parent d3cf879 commit d4467f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -222,7 +222,7 @@ public function testDoHelpersTrailingCommas() {
public function testDoComponentsNo() {
$this->Task->expects($this->any())->method('in')->will($this->returnValue('n'));
$result = $this->Task->doComponents();
$this->assertSame(array('Paginator'), $result);
$this->assertSame(array('Paginator', 'Flash'), $result);
}

/**
Expand All @@ -235,7 +235,7 @@ public function testDoComponentsTrailingSpaces() {
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue(' RequestHandler, Security '));

$result = $this->Task->doComponents();
$expected = array('Paginator', 'RequestHandler', 'Security');
$expected = array('Paginator', 'Flash', 'RequestHandler', 'Security');
$this->assertEquals($expected, $result);
}

Expand All @@ -249,7 +249,7 @@ public function testDoComponentsTrailingCommas() {
$this->Task->expects($this->at(1))->method('in')->will($this->returnValue(' RequestHandler, Security, , '));

$result = $this->Task->doComponents();
$expected = array('Paginator', 'RequestHandler', 'Security');
$expected = array('Paginator', 'Flash', 'RequestHandler', 'Security');
$this->assertEquals($expected, $result);
}

Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Test/bake_compare/Controller/ActionsUsingSessions.ctp
Expand Up @@ -33,10 +33,10 @@
if ($this->request->is('post')) {
$this->BakeArticle->create();
if ($this->BakeArticle->save($this->request->data)) {
$this->Session->setFlash(__('The bake article has been saved.'));
$this->Flash->success(__('The bake article has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The bake article could not be saved. Please, try again.'));
$this->Flash->error(__('The bake article could not be saved. Please, try again.'));
}
}
$bakeTags = $this->BakeArticle->BakeTag->find('list');
Expand All @@ -56,10 +56,10 @@
}
if ($this->request->is(array('post', 'put'))) {
if ($this->BakeArticle->save($this->request->data)) {
$this->Session->setFlash(__('The bake article has been saved.'));
$this->Flash->success(__('The bake article has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The bake article could not be saved. Please, try again.'));
$this->Flash->error(__('The bake article could not be saved. Please, try again.'));
}
} else {
$options = array('conditions' => array('BakeArticle.' . $this->BakeArticle->primaryKey => $id));
Expand All @@ -83,9 +83,9 @@
}
$this->request->allowMethod('post', 'delete');
if ($this->BakeArticle->delete()) {
$this->Session->setFlash(__('The bake article has been deleted.'));
$this->Flash->success(__('The bake article has been deleted.'));
} else {
$this->Session->setFlash(__('The bake article could not be deleted. Please, try again.'));
$this->Flash->error(__('The bake article could not be deleted. Please, try again.'));
}
return $this->redirect(array('action' => 'index'));
}

0 comments on commit d4467f9

Please sign in to comment.