예제 #1
0
파일: XmlTest.php 프로젝트: alab1001101/zf2
 /**
  * @group ZF-11161
  */
 public function testObjectsWithStringSerializationAreIncludedInFormattedString()
 {
     $options = array('rootElement' => 'log');
     $event = array('message' => 'tottakai', 'priority' => 4, 'context' => array('test' => 'one'), 'reference' => new SerializableObject());
     $expected = '<log><message>tottakai</message><priority>4</priority><reference>ZendTest\\Log\\TestAsset\\SerializableObject</reference></log>';
     $formatter = XmlFormatter::factory($options);
     $output = $formatter->format($event);
     $this->assertContains($expected, $output);
 }
예제 #2
0
 /**
  * @group ZF-9176
  */
 public function testFactory()
 {
     $options = array(
         'rootElement' => 'log',
         'elementMap' => array(
             'timestamp' => 'timestamp',
             'response' => 'message'
         )
     );
     $formatter = XmlFormatter::factory($options);
     $this->assertInstanceOf('Zend\Log\Formatter\Xml', $formatter);
 }