Пример #1
0
 protected function doApiRequest($params, $session = null, $appendModule = false)
 {
     if (is_null($session)) {
         $session = array();
     }
     $request = new FauxRequest($params, true, $session);
     $module = new ApiMain($request, true);
     $module->execute();
     $results = array($module->getResultData(), $request, $request->getSessionArray());
     if ($appendModule) {
         $results[] = $module;
     }
     return $results;
 }
Пример #2
0
 /**
  * @covers FauxRequest::__construct
  * @covers FauxRequest::getSessionArray
  */
 public function testSessionData()
 {
     $values = ['x' => 'Value', 'y' => ''];
     $req = new FauxRequest([], false, $values);
     $this->assertEquals($values, $req->getSessionArray());
     $req = new FauxRequest();
     $this->assertSame(null, $req->getSessionArray());
 }