PHPUnit_Extensions_Database_TestCase::createXMLDataSet PHP Method

createXMLDataSet() protected method

Creates a new XMLDataSet with the given $xmlFile. (absolute path.)
protected createXMLDataSet ( string $xmlFile ) : PHPUnit_Extensions_Database_DataSet_XmlDataSet
$xmlFile string
return PHPUnit_Extensions_Database_DataSet_XmlDataSet
    protected function createXMLDataSet($xmlFile)
    {
        return new PHPUnit_Extensions_Database_DataSet_XmlDataSet($xmlFile);
    }

Usage Example

Exemplo n.º 1
0
 public function createXMLDataSet($path)
 {
     $db_config = $this->get_database_config();
     // Firebird requires table and column names to be uppercase
     if ($db_config['dbms'] == 'firebird') {
         $xml_data = file_get_contents($path);
         $xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data);
         $xml_data = preg_replace_callback('/(?:(<column>))([a-z_]+)(?:(<\\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data);
         $new_fixture = tmpfile();
         fwrite($new_fixture, $xml_data);
         fseek($new_fixture, 0);
         $meta_data = stream_get_meta_data($new_fixture);
         $path = $meta_data['uri'];
     }
     $this->fixture_xml_data = parent::createXMLDataSet($path);
     return $this->fixture_xml_data;
 }
All Usage Examples Of PHPUnit_Extensions_Database_TestCase::createXMLDataSet