Merge pull request #33 from box/improve_code_coverage
Improve code coverage
This commit is contained in:
commit
a848be52de
3 files changed
+47
-1
No files matched your search
@@ -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
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user