/** * Prepare the writer. * * @return void */ public function prepare() { $this->arffFile->write($this->filename); }
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; }