本文整理匯總了PHP中Writer::format方法的典型用法代碼示例。如果您正苦於以下問題:PHP Writer::format方法的具體用法?PHP Writer::format怎麽用?PHP Writer::format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Writer
的用法示例。
在下文中一共展示了Writer::format方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testFormat
/**
* @covers Itkg\Log\Formatter\StringFormatter::format
*/
public function testFormat()
{
$text = "it's a test";
$this->assertEquals($text, $this->object->format(array('message' => $text)));
$text = "it's a test with éàêâ";
$this->assertEquals('UTF-8', mb_detect_encoding($this->object->format(array('message' => $text))));
$text = "it is a new text";
$textEncodeUtf8 = utf8_encode($text);
$this->assertEquals($textEncodeUtf8, $this->object->format(array('message' => $text)));
$this->assertEquals($text, utf8_decode($this->object->format(array('message' => $text))));
}
示例2: testFormat
/**
* @covers Itkg\Log\Formatter\SimpleFormatter::format
*/
public function testFormat()
{
$text = "it's a test";
$this->assertEquals($text, $this->object->format(array('message' => $text)));
}