Esempio n. 1
0
 public function test_json_encode()
 {
     $result = Raven_Compat::json_encode(array('foo' => array('bar' => 1)));
     $this->assertEquals($result, '{"foo":{"bar":1}}');
     $result = Raven_Compat::_json_encode(array('foo' => array('bar' => 1)));
     $this->assertEquals($result, '{"foo":{"bar":1}}');
 }
Esempio n. 2
0
 public function test_json_encode()
 {
     $result = Raven_Compat::json_encode(array('foo' => array('bar' => 1)));
     $this->assertEquals('{"foo":{"bar":1}}', $result);
     $result = Raven_Compat::_json_encode(array('foo' => array('bar' => 1)));
     $this->assertEquals('{"foo":{"bar":1}}', $result);
     $result = Raven_Compat::_json_encode(array(1, 2, 3, 4, 'foo', 'bar'));
     $this->assertEquals('[1,2,3,4,"foo","bar"]', $result);
     $result = Raven_Compat::_json_encode(array(1, 'foo', 'foobar' => 'bar'));
     $this->assertEquals('{0:1,1:"foo","foobar":"bar"}', $result);
     $result = Raven_Compat::_json_encode(array(array()));
     $this->assertEquals('[[]]', $result);
 }