Adjust CSV test

refs #2655
This commit is contained in:
Alexander A. Klimov 2017-10-20 12:19:37 +02:00
parent 1d4c327437
commit a7988a08aa

View File

@ -6,6 +6,7 @@ namespace Tests\Icinga\File;
use Icinga\Data\DataArray\ArrayDatasource; use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\File\Csv; use Icinga\File\Csv;
use Icinga\Test\BaseTestCase; use Icinga\Test\BaseTestCase;
use Icinga\Util\Buffer;
class CsvTest extends BaseTestCase class CsvTest extends BaseTestCase
{ {
@ -16,8 +17,6 @@ class CsvTest extends BaseTestCase
array('col1' => 'val5', 'col2' => 'val6', 'col3' => 'val7', 'col4' => 'val8') array('col1' => 'val5', 'col2' => 'val6', 'col3' => 'val7', 'col4' => 'val8')
)); ));
$csv = Csv::fromQuery($data->select());
$this->assertEquals( $this->assertEquals(
implode( implode(
"\r\n", "\r\n",
@ -27,7 +26,7 @@ class CsvTest extends BaseTestCase
'"val5","val6","val7","val8"' '"val5","val6","val7","val8"'
) )
) . "\r\n", ) . "\r\n",
(string) $csv, (string) Csv::queryToStream($data->select(), new Buffer()),
'Csv does not render valid/correct csv structured data' 'Csv does not render valid/correct csv structured data'
); );
} }