Skip to content

Commit

Permalink
Merge pull request #3 from keboola/webrouse-COM-487-fix-name
Browse files Browse the repository at this point in the history
Fix missing name + test
  • Loading branch information
michaljurecko authored Oct 27, 2020
2 parents 0ad746e + 30c70d3 commit f3abf0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Keboola/CsvTable/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Table extends CsvWriter {

public function __construct(string $name, array $header = [], bool $writeHeader = true, Temp $temp = null, $delimiter = CsvOptions::DEFAULT_DELIMITER, $enclosure = CsvOptions::DEFAULT_ENCLOSURE, $lineBreak = "\n")
{
$this->name = $name;
$this->temp = $temp ? $temp : new Temp('csv-table');
$this->header = $header;
$tmpFile = $this->temp ->createTmpFile($name);
Expand Down
3 changes: 2 additions & 1 deletion tests/Keboola/CsvTable/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TempTest extends TestCase
{
public function testCreate()
{
$table = new Table('filename_suffix', ['first_col', 'second_col']);
$table = new Table('filename', ['first_col', 'second_col']);
$this->assertFileExists($table->getPathName());
$this->assertEquals(
'"first_col","second_col"
Expand All @@ -22,6 +22,7 @@ public function testCreate()
),
$table->getHeader()
);
$this->assertEquals('filename', $table->getName());
}

public function testDontWriteHeader()
Expand Down

0 comments on commit f3abf0d

Please sign in to comment.