Beispiel #1
0
 /**
  * @covers \vsc\presentation\requests\RawHttpRequest::getRawVar()
  * @covers \vsc\presentation\requests\RawHttpRequest::constructRawVars()
  */
 public function testGetRawVarsJsonData()
 {
     $o = new PopulatedRawRequest();
     $testVal = array();
     $testVal['ana'] = 'mere';
     $testVal['gigel'] = 'pere';
     $testVal['random'] = uniqid('test:');
     $o->setContentType('application/json');
     $o->constructRawVars(json_encode($testVal));
     $aRawVars = $o->getRawVars();
     $this->assertEquals($testVal, $aRawVars);
     $this->assertEquals($testVal['ana'], $aRawVars['ana']);
     $this->assertEquals($testVal['gigel'], $aRawVars['gigel']);
     $this->assertEquals($testVal['random'], $aRawVars['random']);
 }
Beispiel #2
0
 /**
  * @covers \vsc\presentation\requests\RawHttpRequest::getRawVar()
  * @covers \vsc\presentation\requests\RawHttpRequest::constructRawVars()
  */
 public function testRawGetVarJsonData()
 {
     $o = new PopulatedRawRequest();
     $testVal = array();
     $testVal['ana'] = 'mere';
     $testVal['gigel'] = 'pere';
     $testVal['random'] = uniqid('test:');
     $o->setContentType('application/json');
     $o->constructRawVars(json_encode($testVal));
     $this->assertEquals($testVal['ana'], $o->getRawVar('ana'));
     $this->assertEquals($testVal['gigel'], $o->getRawVar('gigel'));
     $this->assertEquals($testVal['random'], $o->getRawVar('random'));
     $testVal = new \stdClass();
     $testVal->ana = 'mere';
     $testVal->gigel = 'pere';
     $testVal->random = uniqid('test:');
     $o->setContentType('application/json');
     $o->constructRawVars(json_encode($testVal));
     $this->assertEquals($testVal->ana, $o->getRawVar('ana'));
     $this->assertEquals($testVal->gigel, $o->getRawVar('gigel'));
     $this->assertEquals($testVal->random, $o->getRawVar('random'));
 }