/**
  * Test jsData->parse()
  */
 public function testParse()
 {
     $data = array();
     $var = $this->jsData->parse();
     $this->assertEquals(json_encode($data), $var);
     $data = new \stdClass();
     $data->{'request.locale'} = 'nl';
     $this->jsData->setRequestStack($this->getRequestStack());
     $var = $this->jsData->parse();
     $this->assertEquals(json_encode($data), $var);
 }
Esempio n. 2
0
 /**
  * Test jsData->get()
  */
 public function testGet()
 {
     // request is only parsed when fetching the data from the javascript
     (string) $this->jsData;
     $this->assertEquals('nl', $this->jsData->get('request')['locale']);
 }