15 class ArrayDataSet extends \PHPUnit_Extensions_Database_DataSet_AbstractDataSet {
22 foreach ($data AS $tableName => $rows) {
24 if (isset($rows[0])) {
25 $columns = array_keys($rows[0]);
28 $metaData = new \PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($tableName, $columns);
29 $table = new \PHPUnit_Extensions_Database_DataSet_DefaultTable($metaData);
31 foreach ($rows AS $row) {
34 $this->tables[$tableName] = $table;
39 return new \PHPUnit_Extensions_Database_DataSet_DefaultTableIterator($this->tables, $reverse);
43 if (!isset($this->tables[$tableName])) {
44 throw new InvalidArgumentException(
"$tableName is not a table in the current database.");
47 return $this->tables[$tableName];
createIterator($reverse=FALSE)