Skip to content

Commit d4467f9

Browse files
Fixing unit tests.
1 parent d3cf879 commit d4467f9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/Cake/Test/Case/Console/Command/Task/ControllerTaskTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function testDoHelpersTrailingCommas() {
222222
public function testDoComponentsNo() {
223223
$this->Task->expects($this->any())->method('in')->will($this->returnValue('n'));
224224
$result = $this->Task->doComponents();
225-
$this->assertSame(array('Paginator'), $result);
225+
$this->assertSame(array('Paginator', 'Flash'), $result);
226226
}
227227

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

237237
$result = $this->Task->doComponents();
238-
$expected = array('Paginator', 'RequestHandler', 'Security');
238+
$expected = array('Paginator', 'Flash', 'RequestHandler', 'Security');
239239
$this->assertEquals($expected, $result);
240240
}
241241

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

251251
$result = $this->Task->doComponents();
252-
$expected = array('Paginator', 'RequestHandler', 'Security');
252+
$expected = array('Paginator', 'Flash', 'RequestHandler', 'Security');
253253
$this->assertEquals($expected, $result);
254254
}
255255

lib/Cake/Test/bake_compare/Controller/ActionsUsingSessions.ctp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
if ($this->request->is('post')) {
3434
$this->BakeArticle->create();
3535
if ($this->BakeArticle->save($this->request->data)) {
36-
$this->Session->setFlash(__('The bake article has been saved.'));
36+
$this->Flash->success(__('The bake article has been saved.'));
3737
return $this->redirect(array('action' => 'index'));
3838
} else {
39-
$this->Session->setFlash(__('The bake article could not be saved. Please, try again.'));
39+
$this->Flash->error(__('The bake article could not be saved. Please, try again.'));
4040
}
4141
}
4242
$bakeTags = $this->BakeArticle->BakeTag->find('list');
@@ -56,10 +56,10 @@
5656
}
5757
if ($this->request->is(array('post', 'put'))) {
5858
if ($this->BakeArticle->save($this->request->data)) {
59-
$this->Session->setFlash(__('The bake article has been saved.'));
59+
$this->Flash->success(__('The bake article has been saved.'));
6060
return $this->redirect(array('action' => 'index'));
6161
} else {
62-
$this->Session->setFlash(__('The bake article could not be saved. Please, try again.'));
62+
$this->Flash->error(__('The bake article could not be saved. Please, try again.'));
6363
}
6464
} else {
6565
$options = array('conditions' => array('BakeArticle.' . $this->BakeArticle->primaryKey => $id));
@@ -83,9 +83,9 @@
8383
}
8484
$this->request->allowMethod('post', 'delete');
8585
if ($this->BakeArticle->delete()) {
86-
$this->Session->setFlash(__('The bake article has been deleted.'));
86+
$this->Flash->success(__('The bake article has been deleted.'));
8787
} else {
88-
$this->Session->setFlash(__('The bake article could not be deleted. Please, try again.'));
88+
$this->Flash->error(__('The bake article could not be deleted. Please, try again.'));
8989
}
9090
return $this->redirect(array('action' => 'index'));
9191
}

0 commit comments

Comments
 (0)