Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
PU_testcase_dcp_action.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Dcp\Pu;
4 /**
5  * @author Anakeen
6  * @package Dcp\Pu
7  */
8 
9 require_once 'PU_testcase_dcp.php';
10 
12 {
13  /**
14  * Action to test initiate by setUpAction
15  *
16  * @var \Action
17  */
18  protected $testAction;
19 
20  private $currentSetParameters = array();
21 
22  /**
23  * Set up a false Action object can be used to execute action
24  *
25  * @param string $appName application name
26  * @param string $actionName action name
27  *
28  * @return void
29  */
30  protected function setUpTestAction($appName, $actionName) {
31  global $action;
32 
33  SetHttpVar("app", $appName);
34  SetHttpVar("action", $actionName);
35 
36  $appCalled = new \Application();
37  $appCalled->set($appName, $action->parent,$action->parent->session);
38  $appCalled->user=$action->user;
39  if ($appCalled->isAffected() ) {
40  $this->testAction = new \Action();
41  $this->testAction->set($actionName, $appCalled);
42  }
43  }
44 
45  protected function setCurrentParameters($param, $value) {
46  $this->currentSetParameters[] = $param;
47  setHttpVar($param, $value);
48  }
49 
50  protected function resetCurrentParameters() {
51  foreach ($this->currentSetParameters as $currentParam) {
52  setHttpVar($currentParam, null);
53  }
54  $this->currentSetParameters = array();
55  }
56 }
57 ?>
global $action
SetHttpVar($name, $def)
Definition: Lib.Http.php:150
setUpTestAction($appName, $actionName)
$param
Definition: import_size.php:31
$value
← centre documentaire © anakeen