public function testGetType() { $Stop = new \Stop\Dumper\Json($hide = false, $continue = false, $return = true, \Stop\Dumper\AbstractDumper::FORMAT_JSON); $output = $Stop->get_type($Stop); $this->assertContains('StopType!', $output); $this->assertContains('"Class":"Stop\\\\Dumper\\\\Json', $output); $this->assertContains('Stop\\\\Dumper\\\\DumperInterface', $output); $this->assertContains('Stop\\/Tests\\/JsonTest.php', $output, 'File is found'); $output = $Stop->get_type(array(1, 2, 3, 4)); $this->assertContains('StopType!', $output); $this->assertContains('"Type":"array"', $output); $this->assertContains('"Count":4', $output); $output = $Stop->get_type($str = "asdasdasd asdasdasd"); $this->assertContains('StopType!', $output); $this->assertContains('"Type":"string"', $output); $this->assertContains('"Length":19', $output); }
/** * 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); }