@@ -304,12 +304,36 @@ function testBakeActionsWithNoSessions() {
304
304
305
305
$ this ->assertTrue (strpos ($ result , 'function edit($id = null) ' ) !== false );
306
306
$ this ->assertTrue (strpos ($ result , "\$this->Article->Tag->find('list') " ) !== false );
307
+ $ this ->assertTrue (strpos ($ result , "\$this->set(compact('tags')) " ) !== false );
307
308
308
309
$ this ->assertTrue (strpos ($ result , 'function delete($id = null) ' ) !== false );
309
310
$ this ->assertTrue (strpos ($ result , 'if ($this->Article->del($id)) ' ) !== false );
310
311
$ this ->assertTrue (strpos ($ result , "\$this->flash(__('Article deleted', true), array('action'=>'index')) " ) !== false );
311
312
}
312
313
314
+ /**
315
+ * test Interactive mode.
316
+ *
317
+ * @return void
318
+ **/
319
+ function testInteractive () {
320
+ $ this ->Task ->connection = 'test_suite ' ;
321
+ $ this ->Task ->path = '/my/path ' ;
322
+ $ this ->Task ->setReturnValueAt (0 , 'in ' , '1 ' );
323
+ $ this ->Task ->setReturnValueAt (1 , 'in ' , 'y ' ); // build interactive
324
+ $ this ->Task ->setReturnValueAt (2 , 'in ' , 'n ' ); // build no scaffolds
325
+ $ this ->Task ->setReturnValueAt (3 , 'in ' , 'y ' ); // build normal methods
326
+ $ this ->Task ->setReturnValueAt (4 , 'in ' , 'n ' ); // build admin methods
327
+ $ this ->Task ->setReturnValueAt (5 , 'in ' , 'n ' ); // helpers?
328
+ $ this ->Task ->setReturnValueAt (6 , 'in ' , 'n ' ); // components?
329
+ $ this ->Task ->setReturnValueAt (7 , 'in ' , 'y ' ); // use sessions
330
+ $ this ->Task ->setReturnValueAt (8 , 'in ' , 'y ' ); // looks good
331
+
332
+ $ this ->Task ->execute ();
333
+
334
+ $ filename = '/my/path/articles_controller.php ' ;
335
+ $ this ->Task ->expectAt (0 , 'createFile ' , array ($ filename , new PatternExpectation ('/class ArticlesController/ ' )));
336
+ }
313
337
/**
314
338
* test that execute runs all when the first arg == all
315
339
*
0 commit comments