/** * 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); }
/** * 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']); }