Пример #1
0
 public function testJsonFormat()
 {
     $Stop = new \Stop\Dumper\Json(false, false, true, \Stop\Dumper\AbstractDumper::FORMAT_JSON);
     $jsonFixture = file_get_contents(__DIR__ . '/../Fixtures/test.json');
     $output = $Stop->var_dump($jsonFixture);
     $obj = json_decode($output);
     $this->assertObjectHasAttribute('claim', $obj);
     $this->assertContains('json\\/string', $output, 'json/string');
     $this->assertContains('Stop\\/Tests\\/JsonTest.php', $output, 'File is found');
     $this->assertEquals('44', $obj->line);
     $this->assertEquals('pa1', $obj->dump->value->pa1->name);
 }
Пример #2
0
 /**
  * dump a variable as json
  *
  * @param $var
  * @param bool $continue
  * @param bool $hide
  * @param bool $return
  */
 public static function json($var, $continue = false, $hide = false, $return = false)
 {
     $Stop = new \Stop\Dumper\Json($hide, $continue, $return, Dumper\AbstractDumper::FORMAT_JSON);
     $Stop->var_dump($var);
 }