/** * @param string $filename * @param string $name * @param ColumnInterface[] $columns * * @codeCoverageIgnore */ public function __construct($filename, $name, array $columns) { $this->filename = $filename; $this->arffFile = new ArffFile($name); foreach ($columns as $column) { $this->arffFile->addColumn($column); } }
protected function mockArffFile() { $file = new ArffFile('foobar'); $file->addColumn(Mockery::mock('Cocur\\Arff\\Column\\ColumnInterface', ['getName' => 'a', 'render' => '@ATTRIBUTE a string'])); $file->addColumn(Mockery::mock('Cocur\\Arff\\Column\\ColumnInterface', ['getName' => 'b', 'render' => '@ATTRIBUTE b numeric'])); $file->addColumn(Mockery::mock('Cocur\\Arff\\Column\\ColumnInterface', ['getName' => 'c', 'render' => '@ATTRIBUTE c {x,y,z}'])); $file->addColumn(Mockery::mock('Cocur\\Arff\\Column\\ColumnInterface', ['getName' => 'd', 'render' => '@ATTRIBUTE d date "yyyy-MM-dd HH:mm:ss"'])); $file->addData(['a' => 'hello', 'b' => 1.5, 'c' => 'x', 'd' => '2015-07-17 16:12:30']); $file->addData(['a' => 'hello world', 'b' => 1.5, 'c' => 'x y']); $file->addData(['a' => 'hello', 'c' => 'z']); $file->addData(['a' => 'hello,world']); $file->addData(['a' => 'hello;world']); return $file; }