mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Only re-formated source code slightly
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace ParseCsv\tests\methods;
|
namespace ParseCsv\tests\methods;
|
||||||
|
|
||||||
use ParseCsv\Csv;
|
use ParseCsv\Csv;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
class ParseTest extends TestCase
|
class ParseTest extends TestCase {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Csv object
|
* @var Csv object
|
||||||
@@ -41,7 +41,7 @@ class ParseTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends test_parse
|
* @depends test_parse
|
||||||
*
|
*
|
||||||
* @dataProvider autoDetectionProvider
|
* @dataProvider autoDetectionProvider
|
||||||
*/
|
*/
|
||||||
@@ -54,7 +54,7 @@ class ParseTest extends TestCase
|
|||||||
$this->assertEquals($this->_get_magazines_data(), $this->csv->data);
|
$this->assertEquals($this->_get_magazines_data(), $this->csv->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function autoDetectionProvider(){
|
public function autoDetectionProvider() {
|
||||||
return [
|
return [
|
||||||
'UTF8_no_BOM' => [__DIR__ . '/../example_files/UTF-8_sep_row_but_no_BOM.csv'],
|
'UTF8_no_BOM' => [__DIR__ . '/../example_files/UTF-8_sep_row_but_no_BOM.csv'],
|
||||||
'UTF8' => [__DIR__ . '/../example_files/UTF-8_with_BOM_and_sep_row.csv'],
|
'UTF8' => [__DIR__ . '/../example_files/UTF-8_with_BOM_and_sep_row.csv'],
|
||||||
@@ -147,7 +147,7 @@ class ParseTest extends TestCase
|
|||||||
'publishedAt' => 'date',
|
'publishedAt' => 'date',
|
||||||
'published' => 'boolean',
|
'published' => 'boolean',
|
||||||
'count' => 'integer',
|
'count' => 'integer',
|
||||||
'price' => 'float'
|
'price' => 'float',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->assertEquals($expected, $this->csv->data_types);
|
$this->assertEquals($expected, $this->csv->data_types);
|
||||||
@@ -173,8 +173,8 @@ class ParseTest extends TestCase
|
|||||||
$this->csv->heading = false;
|
$this->csv->heading = false;
|
||||||
$this->csv->offset = 2;
|
$this->csv->offset = 2;
|
||||||
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
|
$this->csv->auto(__DIR__ . '/fixtures/datatype.csv');
|
||||||
$expected = range(0,5, 1);
|
$expected = range(0, 5, 1);
|
||||||
|
|
||||||
$this->assertEquals($expected, array_keys($this->csv->data[0]));
|
$this->assertEquals($expected, array_keys($this->csv->data[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ class ParseTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testSepRowAutoDetection
|
* @depends testSepRowAutoDetection
|
||||||
*
|
*
|
||||||
* @dataProvider autoQuotesDataProvider
|
* @dataProvider autoQuotesDataProvider
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user