Dispatch =& new BakeShellMockShellDispatcher(); $this->Shell =& new MockBakeShell(); $this->Shell->Dispatch =& $this->Dispatcher; $this->Shell->Dispatch->shellPaths = App::path('shells'); } /** * test bake all * * @return void **/ function testAllWithModelName() { $this->Shell->Model =& new BakeShellMockModelTask(); $this->Shell->Controller =& new BakeShellMockControllerTask(); $this->Shell->View =& new BakeShellMockModelTask(); $this->Shell->DbConfig =& new BakeShellMockDbConfigTask(); $this->Shell->DbConfig->expectOnce('getConfig'); $this->Shell->DbConfig->setReturnValue('getConfig', 'test_suite'); $this->Shell->Model->setReturnValue('bake', true); $this->Shell->Model->expectNever('getName'); $this->Shell->Model->expectOnce('bake'); $this->Shell->Controller->expectOnce('bake'); $this->Shell->Controller->setReturnValue('bake', true); $this->Shell->View->expectOnce('execute'); $this->Shell->expectAt(0, 'out', array('Bake All')); $this->Shell->expectAt(1, 'out', array('Article Model was baked.')); $this->Shell->expectAt(2, 'out', array('Article Controller was baked.')); $this->Shell->expectAt(3, 'out', array('Article Views were baked.')); $this->Shell->expectAt(4, 'out', array('Bake All complete')); $this->Shell->params = array(); $this->Shell->args = array('Article', 'exitvalue'); $this->Shell->all(); } }