write() 공개 정적인 메소드

public static write ( PHPUnit_Extensions_Database_DataSet_IDataSet $dataset, $filename )
$dataset PHPUnit_Extensions_Database_DataSet_IDataSet
예제 #1
0
 public function testXml()
 {
     $dataSetFile = dirname(__FILE__) . '/../_files/XmlDataSets/XmlWriter.xml';
     $filename = dirname(__FILE__) . '/' . uniqid() . '.xml';
     $dataSet = new PHPUnit_Extensions_Database_DataSet_XmlDataSet($dataSetFile);
     PHPUnit_Extensions_Database_DataSet_XmlDataSet::write($dataSet, $filename);
     $this->assertXmlFileEqualsXmlFile($dataSetFile, $filename);
     unlink($filename);
 }
 public function testEntitiesXml()
 {
     $metaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', array('col1', 'col2'), array('col1'));
     $table = new PHPUnit_Extensions_Database_DataSet_DefaultTable($metaData);
     $table->addRow(array('col1' => 1, 'col2' => '<?xml version="1.0"?><myxml>test</myxml>'));
     $dataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array($table));
     $expectedFile = dirname(__FILE__) . '/../_files/XmlDataSets/XmlWriterEntities.xml';
     $filename = dirname(__FILE__) . '/' . uniqid() . '.xml';
     PHPUnit_Extensions_Database_DataSet_XmlDataSet::write($dataSet, $filename);
     $this->assertXmlFileEqualsXmlFile($expectedFile, $filename);
     unlink($filename);
 }