mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Merge branch 'master' into offset-comment-and-tests
Conflicts: tests/methods/ParseTest.php
This commit is contained in:
@@ -57,7 +57,7 @@ class DefaultValuesPropertiesTest extends TestCase {
|
||||
}
|
||||
|
||||
public function test_sort_type_default() {
|
||||
$this->assertNull($this->csv->sort_type);
|
||||
$this->assertEquals('regular', $this->csv->sort_type);
|
||||
}
|
||||
|
||||
public function test_delimiter_default() {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace ParseCsv\tests\properties;
|
||||
|
||||
use ParseCsv\Csv;
|
||||
use ParseCsv\enums\SortEnum;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PublicPropertiesTest extends TestCase {
|
||||
@@ -145,4 +146,26 @@ class PublicPropertiesTest extends TestCase {
|
||||
|
||||
$this->assertCount($counter, $this->properties);
|
||||
}
|
||||
|
||||
public function testDefaultSortTypeIsRegular(){
|
||||
$this->assertEquals(SortEnum::SORT_TYPE_REGULAR, $this->csv->sort_type);
|
||||
}
|
||||
|
||||
public function testSetSortType(){
|
||||
$this->csv->sort_type = 'numeric';
|
||||
$this->assertEquals(SortEnum::SORT_TYPE_NUMERIC, $this->csv->sort_type);
|
||||
|
||||
$this->csv->sort_type = 'string';
|
||||
$this->assertEquals(SortEnum::SORT_TYPE_STRING, $this->csv->sort_type);
|
||||
}
|
||||
|
||||
public function testGetSorting(){
|
||||
$this->csv->sort_type = 'numeric';
|
||||
$sorting = SortEnum::getSorting($this->csv->sort_type);
|
||||
$this->assertEquals(SORT_NUMERIC, $sorting);
|
||||
|
||||
$this->csv->sort_type = 'string';
|
||||
$sorting = SortEnum::getSorting($this->csv->sort_type);
|
||||
$this->assertEquals(SORT_STRING, $sorting);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user