本文整理汇总了PHP中PHPUnit_Extensions_Database_DataSet_CsvDataSet类的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_DataSet_CsvDataSet类的具体用法?PHP PHPUnit_Extensions_Database_DataSet_CsvDataSet怎么用?PHP PHPUnit_Extensions_Database_DataSet_CsvDataSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PHPUnit_Extensions_Database_DataSet_CsvDataSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return PHPUnit_Extensions_Database_DataSet_CsvDataSet
*
* @since 3.1
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_menu', JPATH_TEST_DATABASE . '/jos_menu.csv');
$dataSet->addTable('jos_menu_types', JPATH_TEST_DATABASE . '/jos_menu_types.csv');
return $dataSet;
}
示例2: getCsvDataSet
private function getCsvDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet();
$dataSet->addTable("class", D_DIR . 'class.csv');
$dataSet->addTable("user", D_DIR . 'user.csv');
$dataSet->addTable("address", D_DIR . 'address.csv');
return $dataSet;
}
示例3: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return PHPUnit_Extensions_Database_DataSet_CsvDataSet
*
* @since 3.2
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_users', JPATH_TEST_DATABASE . '/jos_users.csv');
$dataSet->addTable('jos_content', JPATH_TEST_DATABASE . '/jos_content.csv');
//$dataSet->addTable('jos_ucm_base', JPATH_TEST_DATABASE . '/jos_ucm_history.csv');
return $dataSet;
}
示例4: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return PHPUnit_Extensions_Database_DataSet_CsvDataSet
*
* @since 3.1
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_extensions', JPATH_TEST_DATABASE . '/jos_extensions.csv');
$dataSet->addTable('jos_finder_terms_common', JPATH_TEST_DATABASE . '/jos_finder_terms_common.csv');
$dataSet->addTable('jos_finder_types', JPATH_TEST_DATABASE . '/jos_finder_types.csv');
return $dataSet;
}
示例5: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return CSV database tables
*
* @since 11.4
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_assets', dirname(__DIR__) . '/stubs/jos_assets.csv');
$dataSet->addTable('jos_categories', dirname(__DIR__) . '/stubs/jos_categories.csv');
$dataSet->addTable('jos_content', dirname(__DIR__) . '/stubs/jos_content.csv');
return $dataSet;
}
示例6: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return CSV database tables
*
* @since 11.4
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_extensions', __DIR__ . '/stubs/jos_extensions.csv');
return $dataSet;
}
示例7: getDataSet
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_categories', JPATH_TESTS . '/stubs/jos_categories.csv');
$dataSet->addTable('jos_assets', JPATH_TESTS . '/stubs/jos_assets.csv');
$dataSet->addTable('jos_menu', JPATH_TESTS . '/stubs/jos_menu.csv');
return $dataSet;
}
示例8: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return PHPUnit_Extensions_Database_DataSet_CsvDataSet
*
* @since 12.2
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_users', JPATH_TEST_DATABASE . '/jos_users.csv');
$dataSet->addTable('jos_user_usergroup_map', JPATH_TEST_DATABASE . '/jos_user_usergroup_map.csv');
$dataSet->addTable('jos_usergroups', JPATH_TEST_DATABASE . '/jos_usergroups.csv');
return $dataSet;
}
示例9: getDataSet
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet();
$dataSet->addTable('post', 'csv/post.csv');
$dataSet->addTable('post_comment', 'csv/post_comment.csv');
$dataSet->addTable('current_visitors', 'csv/current_visitors.csv');
return $dataSet;
}
示例10: getDataSet
protected function getDataSet()
{
$dataset = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(';', "'");
$dataset->addTable('polling_messages', dirname(__FILE__) . '/fixtures/polling_messages.csv');
$dataset->addTable('polling_users', dirname(__FILE__) . '/fixtures/polling_users.csv');
$dataset->addTable('sessions', dirname(__FILE__) . '/fixtures/sessions.csv');
return $dataset;
}
示例11: getDataSet
/**
* Gets the data set to be loaded into the database during setup
*
* @return CSV database tables
*
* @since 11.4
*/
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$stubpath = JPATH_TESTS . '/suites/unit/joomla/table/stubs';
$dataSet->addTable('jos_assets', $stubpath . '/jos_assets.csv');
$dataSet->addTable('jos_categories', $stubpath . '/jos_categories.csv');
$dataSet->addTable('jos_content', __DIR__ . '/stubs/jos_content.csv');
return $dataSet;
}
示例12: getDataSet
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$refreshTestNames = array('testGetPath', 'testMove', 'testMoveByReference', 'testDelete', 'testStore', 'testGetRootId', 'testOrderUp', 'testRebuild', 'testRebuildPath', 'testSaveorder');
if (in_array($this->name, $refreshTestNames)) {
$dataSet->addTable('jos_categories', JPATH_BASE . '/tests/unit/stubs/jos_categories.csv');
$dataSet->addTable('jos_assets', JPATH_BASE . '/tests/unit/stubs/jos_assets.csv');
$dataSet->addTable('jos_menu', JPATH_BASE . '/tests/unit/stubs/jos_menu.csv');
}
return $dataSet;
}
示例13: testCSVDataSet
public function testCSVDataSet()
{
$table1MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table1', array('table1_id', 'column1', 'column2', 'column3', 'column4'));
$table2MetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData('table2', array('table2_id', 'column5', 'column6', 'column7', 'column8'));
$table1 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table1MetaData);
$table2 = new PHPUnit_Extensions_Database_DataSet_DefaultTable($table2MetaData);
$table1->addRow(array('table1_id' => 1, 'column1' => 'tgfahgasdf', 'column2' => 200, 'column3' => 34.64, 'column4' => 'yghkf;a hahfg8ja h;'));
$table1->addRow(array('table1_id' => 2, 'column1' => 'hk;afg', 'column2' => 654, 'column3' => 46.54, 'column4' => '24rwehhads'));
$table1->addRow(array('table1_id' => 3, 'column1' => 'ha;gyt', 'column2' => 462, 'column3' => 1654.4, 'column4' => 'asfgklg'));
$table2->addRow(array('table2_id' => 1, 'column5' => 'fhah', 'column6' => 456, 'column7' => 46.5, 'column8' => 'fsdb, ghfdas'));
$table2->addRow(array('table2_id' => 2, 'column5' => 'asdhfoih', 'column6' => 654, 'column7' => 'blah', 'column8' => '43asd "fhgj" sfadh'));
$table2->addRow(array('table2_id' => 3, 'column5' => 'ajsdlkfguitah', 'column6' => 654, 'column7' => 'blah', 'column8' => 'thesethasdl
asdflkjsadf asdfsadfhl "adsf, halsdf" sadfhlasdf'));
$expectedDataSet = new PHPUnit_Extensions_Database_DataSet_DefaultDataSet(array($table1, $table2));
$csvDataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet();
$csvDataSet->addTable('table1', dirname(__FILE__) . '/../_files/CsvDataSets/table1.csv');
$csvDataSet->addTable('table2', dirname(__FILE__) . '/../_files/CsvDataSets/table2.csv');
PHPUnit_Extensions_Database_TestCase::assertDataSetsEqual($expectedDataSet, $csvDataSet);
}
示例14: getDataSet
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', "'", '\\');
$dataSet->addTable('jos_assets', JPATH_BASE . '/tests/unit/stubs/jos_assets.csv');
$dataSet->addTable('jos_categories', JPATH_BASE . '/tests/unit/stubs/jos_categories.csv');
$dataSet->addTable('jos_usergroups', JPATH_BASE . '/tests/unit/stubs/jos_usergroups.csv');
$dataSet->addTable('jos_user_usergroup_map', JPATH_BASE . '/tests/unit/stubs/jos_user_usergroup_map.csv');
$dataSet->addTable('jos_users', JPATH_BASE . '/tests/unit/stubs/jos_users.csv');
return $dataSet;
}
示例15: loadDatasetFile
public function loadDatasetFile($filename, $format = '')
{
if ($format == '') {
// try to deduce format from filename/extension
$info = pathinfo($filename);
$format = $info['extension'];
if (substr($filename, -9, 9) == '.flat.xml') {
$format = 'flatxml';
}
}
if ($format == '') {
// absolute default
$format = 'yaml';
}
switch ($format) {
case "flatxml":
$ds = new \PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($filename);
break;
case "csv":
if ($this->tablename == '') {
throw new \InvalidArgumentException('You need to specify a tablename for .csv datasets');
}
$ds = new \PHPUnit_Extensions_Database_DataSet_CsvDataSet(';');
$ds->addTable($this->tablename, $filename);
break;
case "yml":
case "yaml":
$ds = new \PHPUnit_Extensions_Database_DataSet_YamlDataSet($filename, new YamlParser());
break;
case "xml":
$ds = new \PHPUnit_Extensions_Database_DataSet_XmlDataSet($filename);
break;
default:
throw new \InvalidArgumentException('Unsupported format: ' . $format);
break;
}
$this->dataset = $ds;
}