Esempio n. 1
0
 public function render($name)
 {
     $warningsMessenger = \App::get('warnings');
     $warnings = $warningsMessenger->getMessages();
     $vars = $this->getVars();
     if (!empty($vars['prettify'])) {
         $prettify = $vars['prettify'];
         unset($vars['prettify']);
     }
     if ($warnings) {
         $vars['warnings'] = $warnings;
     }
     if (empty($vars)) {
         return ' ';
     }
     $json = App_Json_Encoder::encode($vars);
     $json = isset($prettify) ? $this->_prettify($json) : $json;
     return $json;
 }
Esempio n. 2
0
 /**
  * @group ZF-4054
  *
  * This test contains assertions from the Solar Framework by Paul M. Jones
  *
  * @link http://solarphp.com
  */
 public function testEncodeWithUtf8IsTransformedSolarRegressionEqualsJsonExt()
 {
     if (function_exists('json_encode') == false) {
         $this->markTestSkipped('Test can only be run, when ext/json is installed.');
     }
     $this->assertEquals(json_encode('héllö wørłd'), App_Json_Encoder::encode('héllö wørłd'));
     $this->assertEquals(json_encode("руссиш"), App_Json_Encoder::encode("руссиш"));
 }