PHP Class PHPUnit_Extensions_Database_DataSet_CsvDataSet, qcodo

You can incrementally add CSV files as tables to your datasets
Author: Mike Lively ([email protected])
Inheritance: extends PHPUnit_Extensions_Database_DataSet_AbstractDataSet
Datei anzeigen Open project: qcodo/qcodo Class Usage Examples

Protected Properties

Property Type Description
$delimiter string
$enclosure string
$escape string
$tables array

Public Methods

Method Description
__construct ( string $delimiter = ',', string $enclosure = '"', string $escape = '"' ) Creates a new CSV dataset
addTable ( string $tableName, string $csvFile ) Adds a table to the dataset

Protected Methods

Method Description
createIterator ( boolean $reverse = FALSE ) : PHPUnit_Extensions_Database_DataSet_ITableIterator Creates an iterator over the tables in the data set. If $reverse is true a reverse iterator will be returned.
getCsvRow ( resource $fh ) : array Returns a row from the csv file in an indexed array.

Method Details

__construct() public method

You can pass in the parameters for how csv files will be read.
public __construct ( string $delimiter = ',', string $enclosure = '"', string $escape = '"' )
$delimiter string
$enclosure string
$escape string

addTable() public method

The table will be given the passed name. $csvFile should be a path to a valid csv file (based on the arguments passed to the constructor.)
public addTable ( string $tableName, string $csvFile )
$tableName string
$csvFile string

createIterator() protected method

Creates an iterator over the tables in the data set. If $reverse is true a reverse iterator will be returned.
protected createIterator ( boolean $reverse = FALSE ) : PHPUnit_Extensions_Database_DataSet_ITableIterator
$reverse boolean
return PHPUnit_Extensions_Database_DataSet_ITableIterator

getCsvRow() protected method

Returns a row from the csv file in an indexed array.
protected getCsvRow ( resource $fh ) : array
$fh resource
return array

Property Details

$delimiter protected_oe property

protected string $delimiter
return string

$enclosure protected_oe property

protected string $enclosure
return string

$escape protected_oe property

protected string $escape
return string

$tables protected_oe property

protected array $tables
return array