@@ -318,21 +318,22 @@ function testBakeActionsUsingSessions() {
318
318
$ this ->assertTrue (strpos ($ result , "\$this->set('articles', \$this->paginate()); " ) !== false );
319
319
320
320
$ this ->assertTrue (strpos ($ result , 'function view($id = null) ' ) !== false );
321
- $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(__('Invalid article ', true)) " ) !== false );
321
+ $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(sprintf( __('Invalid %s ', true), 'article')); " ) !== false );
322
322
$ this ->assertTrue (strpos ($ result , "\$this->set('article', \$this->Article->read(null, \$id) " ) !== false );
323
323
324
324
$ this ->assertTrue (strpos ($ result , 'function add() ' ) !== false );
325
325
$ this ->assertTrue (strpos ($ result , 'if (!empty($this->data)) ' ) !== false );
326
326
$ this ->assertTrue (strpos ($ result , 'if ($this->Article->save($this->data)) ' ) !== false );
327
- $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(__('The article has been saved', true)) " ) !== false );
327
+ $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(sprintf( __('The %s has been saved', true), 'article')); " ) !== false );
328
328
329
329
$ this ->assertTrue (strpos ($ result , 'function edit($id = null) ' ) !== false );
330
- $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(__('The article could not be saved. Please, try again.', true)); " ) !== false );
330
+ $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(sprintf( __('The %s could not be saved. Please, try again.', true), 'article' )); " ) !== false );
331
331
332
332
$ this ->assertTrue (strpos ($ result , 'function delete($id = null) ' ) !== false );
333
333
$ this ->assertTrue (strpos ($ result , 'if ($this->Article->delete($id)) ' ) !== false );
334
- $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(__('Article deleted', true)) " ) !== false );
334
+ $ this ->assertTrue (strpos ($ result , "\$this->Session->setFlash(sprintf( __('%s deleted', true), 'Article')); " ) !== false );
335
335
336
+ debug ($ result , true );
336
337
337
338
$ result = $ this ->Task ->bakeActions ('Articles ' , 'admin_ ' , true );
338
339
@@ -362,21 +363,21 @@ function testBakeActionsWithNoSessions() {
362
363
$ this ->assertTrue (strpos ($ result , "\$this->set('articles', \$this->paginate()); " ) !== false );
363
364
364
365
$ this ->assertTrue (strpos ($ result , 'function view($id = null) ' ) !== false );
365
- $ this ->assertTrue (strpos ($ result , "\$this->flash(__('Invalid article ', true), array('action' => 'index')) " ) !== false );
366
+ $ this ->assertTrue (strpos ($ result , "\$this->flash(sprintf( __('Invalid %s ', true), 'article' ), array('action' => 'index')) " ) !== false );
366
367
$ this ->assertTrue (strpos ($ result , "\$this->set('article', \$this->Article->read(null, \$id) " ) !== false );
367
368
368
369
$ this ->assertTrue (strpos ($ result , 'function add() ' ) !== false );
369
370
$ this ->assertTrue (strpos ($ result , 'if (!empty($this->data)) ' ) !== false );
370
371
$ this ->assertTrue (strpos ($ result , 'if ($this->Article->save($this->data)) ' ) !== false );
371
- $ this ->assertTrue (strpos ($ result , "\$this->flash(__('The article has been saved.', true), array('action' => 'index')) " ) !== false );
372
+ $ this ->assertTrue (strpos ($ result , "\$this->flash(sprintf( __('The %s has been saved.', true), 'article' ), array('action' => 'index')) " ) !== false );
372
373
373
374
$ this ->assertTrue (strpos ($ result , 'function edit($id = null) ' ) !== false );
374
375
$ this ->assertTrue (strpos ($ result , "\$this->Article->Tag->find('list') " ) !== false );
375
376
$ this ->assertTrue (strpos ($ result , "\$this->set(compact('tags')) " ) !== false );
376
377
377
378
$ this ->assertTrue (strpos ($ result , 'function delete($id = null) ' ) !== false );
378
379
$ this ->assertTrue (strpos ($ result , 'if ($this->Article->delete($id)) ' ) !== false );
379
- $ this ->assertTrue (strpos ($ result , "\$this->flash(__('Article deleted', true), array('action' => 'index')) " ) !== false );
380
+ $ this ->assertTrue (strpos ($ result , "\$this->flash(sprintf( __('%s deleted', true), 'Article' ), array('action' => 'index')) " ) !== false );
380
381
}
381
382
382
383
/**
0 commit comments