Merge pull request #33 from box/improve_code_coverage

Improve code coverage
This commit is contained in:
Adrien Loison committed 2015-04-29 11:55:37 -07:00
commit a848be52de
3 files changed
+47 -1

No files matched your search

+31
View File
@@ -38,6 +38,37 @@ class XLSXTest extends \PHPUnit_Framework_TestCase
$this->getAllRowsForFile($filePath);
}
/**
* @expectedException \Box\Spout\Reader\Exception\ReaderNotOpenedException
*
* @return void
*/
public function testHasNextSheetShouldThrowExceptionIfReaderNotOpened()
{
$reader = ReaderFactory::create(Type::XLSX);
$reader->hasNextSheet();
}
/**
* @expectedException \Box\Spout\Reader\Exception\EndOfWorksheetsReachedException
*
* @return void
*/
public function testNextSheetShouldThrowExceptionIfNoMoreSheetsToRead()
{
$fileName = 'one_sheet_with_shared_strings.xlsx';
$resourcePath = $this->getResourcePath($fileName);
$reader = ReaderFactory::create(Type::XLSX);
$reader->open($resourcePath);
while ($reader->hasNextSheet()) {
$reader->nextSheet();
}
$reader->nextSheet();
}
/**
* @return array
*/