Is it possible to upload multiple flat xml datasets to PHPUnit to load multiple fixtures?
We are writing a rather complicated application, and the xml dataset is getting quite large, so I would like to skip it at 2-3 xml.
Here is the current code for a test case:
<?php
class My_TestBase extends Zend_Test_PHPUnit_DatabaseTestCase{
protected $_application;
private $_connection;
protected function getConnection(){
if($this->_connection === null){
$Resources = $this->_application->getOption("resources");
$conn = Zend_Db::factory($Resources["db"]["adapter"], $Resources["db"]["params"]);
$this->_connection = $this->createZendDbConnection($conn, $Resources["db"]["params"]["dbname"]);
}
return $this->_connection;
}
protected function getDataSet(){
return $this->createFlatXMLDataSet(__DIR__."/seed_data.xml");
}
protected function setUp(){
$this->_application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
}
}
source
share