keboola / php-csv

CSV reader/writer
MIT License
135 stars 35 forks source link

CsvFileTest::testInitInvalidFileShouldNotThrowException() #11

Closed migueleliasweb closed 6 years ago

migueleliasweb commented 10 years ago

Hello everybody,

i'm about to make a PR to this lib. I found it awesome but it lacks (for me) some no-very-baisc functionalities.

After some changes I had to update some tests, BUT, this testInitInvalidFileShouldNotThrowException method makes me curious about it's assertion.

Why it should not throw an exception ? At CsvFile::_openFile() there's a file existance verification, so, for me, it seems very logic for it to thow the exception...

Ps: This is the one last method for the whole test suit to pass =D

samwilson commented 10 years ago

What if you're creating a new CSV file? Then, the file doesn't exist until the first writeRow() call.

Halama commented 10 years ago

Yes this is the reason why it should not throw exception.

migueleliasweb commented 10 years ago

@Halama + @samwilson . I think I understand both of you. I'll update my repository and make the PR.

Here's the repository: (not yet updated) https://github.com/migueleliasweb/php-csv

Halama commented 6 years ago

I'll close this since new major version is released.