Ejemplo n.º 1
0
 public function testFormat()
 {
     // test integer
     $var = 1;
     $this->assertEquals("2", LogUtil::format($var));
     // test string
     $var = "test";
     $this->assertEquals("test", LogUtil::format($var));
     // test simple array
     $var = array("a" => 1, "b" => 2);
     $this->assertEquals("array(2) {\n  [\"a\"]=>\n  int(1)\n  [\"b\"]=>\n  int(2)\n}\n", LogUtil::format($var));
     // test boolean
     $var = true;
     $this->assertEquals("TRUE", LogUtil::format($var));
     // test object
     // but how to? object->toString()?
 }