Example #1
0
 /**
  * Test the correct Generation of Scaffold Params.
  * This ensures that the correct action and view will be generated
  *
  * @return void
  */
 public function testScaffoldParams()
 {
     $params = array('plugin' => null, 'pass' => array(), 'form' => array(), 'named' => array(), 'url' => array('url' => 'admin/scaffold_mock/edit'), 'controller' => 'scaffold_mock', 'action' => 'admin_edit', 'admin' => true);
     $this->Controller->request->base = '';
     $this->Controller->request->webroot = '/';
     $this->Controller->request->here = '/admin/scaffold_mock/edit';
     $this->Controller->request->addParams($params);
     //set router.
     Router::setRequestInfo($this->Controller->request);
     $this->Controller->constructClasses();
     $Scaffold = new TestScaffoldMock($this->Controller, $this->Controller->request);
     $result = $Scaffold->getParams();
     $this->assertEquals('admin_edit', $result['action']);
 }
Example #2
0
 /**
  * Test the correct Generation of Scaffold Params.
  * This ensures that the correct action and view will be generated
  *
  * @access public
  * @return void
  */
 function testScaffoldParams()
 {
     $this->Controller->action = 'admin_edit';
     $this->Controller->here = '/admin/scaffold_mock/edit';
     $this->Controller->webroot = '/';
     $params = array('plugin' => null, 'pass' => array(), 'form' => array(), 'named' => array(), 'url' => array('url' => 'admin/scaffold_mock/edit'), 'controller' => 'scaffold_mock', 'action' => 'admin_edit', 'admin' => true);
     //set router.
     Router::setRequestInfo(array($params, array('base' => '/', 'here' => 'admin/scaffold_mock', 'webroot' => '/')));
     $this->Controller->params = $params;
     $this->Controller->controller = 'scaffold_mock';
     $this->Controller->base = '/';
     $this->Controller->constructClasses();
     $Scaffold = new TestScaffoldMock($this->Controller, $params);
     $result = $Scaffold->getParams();
     $this->assertEqual($result['action'], 'admin_edit');
 }