protected function callWebservice($apiAction = 'index', $params = null) { if (!$this->webserviceController) { $controller = Yii::app()->createController($this->apiControllerId); $this->webserviceController = $controller[0]; $this->webserviceController->init(); self::$apiControllerConfig = $controller[0]::$configuration; } $this->webserviceController->setRequest(CJSON::encode($params)); $this->webserviceController->setTestMode(true); Yii::app()->setController($this->webserviceController); Yii::app()->controller->run($apiAction); $response = Response::get(); $this->assertArrayHasKey(self::$apiControllerConfig['statusKey'], $response); return $response; }
protected function setUp() { //make your set up here ... parent::setUp(); }