public function testDoDispatch()
 {
     $forward = new WindForward();
     $forward->setIsReAction(true);
     $forward->setAction('/long/test');
     ob_start();
     $this->front->createApplication()->doDispatch($forward);
     $this->assertEquals(ob_get_clean(), 'LongController-test');
 }
 /**
  * Tests WindDispatcher->dispatch()
  */
 public function testDispatch()
 {
     $_SERVER['SCRIPT_FILENAME'] = "index.php";
     $_SERVER['SCRIPT_NAME'] = 'index.php';
     $_SERVER['HTTP_HOST'] = 'localhost';
     $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?c=long&a=noPrint';
     $front = Wind::application('long', array('web-apps' => array('long' => array('modules' => array('default' => array('controller-path' => 'data', 'controller-suffix' => 'Controller', 'error-handler' => 'TEST:data.ErrorControllerTest'))))))->run();
     $forward = new WindForward();
     $forward->setIsReAction(true);
     $forward->setAction('/long/test');
     ob_start();
     Wind::getApp()->doDispatch($forward);
     $this->assertEquals(ob_get_clean(), 'LongController-test');
 }
 public function testResolveActionFilter()
 {
     require_once 'data/Listener.php';
     Wind::application()->createApplication();
     $errorMessage = new WindErrorMessage("shi");
     $this->testController->setErrorMessage($errorMessage);
     $forward = new WindForward();
     $forward->setAction("long");
     $this->testController->setForward($forward);
     $_GET['name'] = 'shilong';
     $this->testController->setGlobal('shilong', 'name');
     $forward->setVars('name', 'xxxxx');
     $_GET['wuq'] = 'wuq';
     $this->testController->resolveActionFilter($this->dataForResolveActionFilter());
     $this->assertEquals("post_post_post_pre_pre_pre_shi", $errorMessage->getError(0));
     $this->assertEquals("post_post_post_pre_pre_pre_long", $forward->getAction());
 }
示例#4
0
 public function postHandle()
 {
     $this->forward->setAction('post_' . $this->forward->getAction());
     $this->errorMessage->addError('post_' . $this->errorMessage->getError(0), 0);
 }