mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
renamed function to getTotalDataRowCount
This commit is contained in:
@@ -547,7 +547,7 @@ class Csv {
|
|||||||
*
|
*
|
||||||
* @return bool|int
|
* @return bool|int
|
||||||
*/
|
*/
|
||||||
public function getTotalRowCount() {
|
public function getTotalDataRowCount() {
|
||||||
if (empty($this->file_data)) {
|
if (empty($this->file_data)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class ParseTest extends TestCase
|
|||||||
public function testGetTotalRowCountFromFile($file, $expectedRows){
|
public function testGetTotalRowCountFromFile($file, $expectedRows){
|
||||||
$this->csv->heading = true;
|
$this->csv->heading = true;
|
||||||
$this->csv->load_data(__DIR__ . '/fixtures/' . $file);
|
$this->csv->load_data(__DIR__ . '/fixtures/' . $file);
|
||||||
$this->assertEquals($expectedRows, $this->csv->getTotalRowCount());
|
$this->assertEquals($expectedRows, $this->csv->getTotalDataRowCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetTotalRowCountMissingEndingLineBreak(){
|
public function testGetTotalRowCountMissingEndingLineBreak(){
|
||||||
@@ -233,6 +233,6 @@ class ParseTest extends TestCase
|
|||||||
$this->csv->enclosure = '"';
|
$this->csv->enclosure = '"';
|
||||||
$sInput = "86545235689,a\r\n34365587654,b\r\n13469874576,\"c\r\nd\"";
|
$sInput = "86545235689,a\r\n34365587654,b\r\n13469874576,\"c\r\nd\"";
|
||||||
$this->csv->load_data($sInput);
|
$this->csv->load_data($sInput);
|
||||||
$this->assertEquals(3, $this->csv->getTotalRowCount());
|
$this->assertEquals(3, $this->csv->getTotalDataRowCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user