Ejemplo n.º 1
0
 /**
  * testRender method
  *
  * @return void
  */
 public function testRender()
 {
     Plugin::load('TestPlugin');
     $request = new Request('controller_posts/index');
     $request->params['action'] = 'index';
     $Controller = new Controller($request, new Response());
     $Controller->viewPath = 'Posts';
     $result = $Controller->render('index');
     $this->assertRegExp('/posts index/', (string) $result);
     $Controller->view = 'index';
     $Controller->getView()->hasRendered = false;
     $result = $Controller->render();
     $this->assertRegExp('/posts index/', (string) $result);
     $Controller->getView()->hasRendered = false;
     $result = $Controller->render('/Element/test_element');
     $this->assertRegExp('/this is the test element/', (string) $result);
     $Controller->view = null;
 }