Remove @expectedException annotation

This commit is contained in:
Adrien Loison committed 2017-11-05 02:21:09 +01:00
1 parent 7274226b75
commit 3851e05f83
20 files changed
+173 -74

No files matched your search

@@ -2,6 +2,8 @@
namespace Box\Spout\Reader\XLSX\Helper;
use Box\Spout\Common\Exception\InvalidArgumentException;
/**
* Class CellHelperTest
*/
@@ -58,12 +60,12 @@ class CellHelperTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException \Box\Spout\Common\Exception\InvalidArgumentException
*
* @return void
*/
public function testGetColumnIndexFromCellIndexShouldThrowIfInvalidCellIndex()
{
$this->expectException(InvalidArgumentException::class);
CellHelper::getColumnIndexFromCellIndex('InvalidCellIndex');
}
}
@@ -2,6 +2,7 @@
namespace Box\Spout\Reader\XLSX\Manager;
use Box\Spout\Reader\Exception\SharedStringNotFoundException;
use Box\Spout\Reader\XLSX\Creator\EntityFactory;
use Box\Spout\Reader\XLSX\Creator\HelperFactory;
use Box\Spout\Reader\XLSX\Creator\ManagerFactory;
@@ -57,11 +58,12 @@ class SharedStringsManagerTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException \Box\Spout\Reader\Exception\SharedStringNotFoundException
* @return void
*/
public function testGetStringAtIndexShouldThrowExceptionIfStringNotFound()
{
$this->expectException(SharedStringNotFoundException::class);
$sharedStringsManager = $this->createSharedStringsManager();
$sharedStringsManager->extractSharedStrings();
$sharedStringsManager->getStringAtIndex(PHP_INT_MAX);
+6 -5
View File
@@ -29,13 +29,14 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider dataProviderForTestReadShouldThrowException
* @expectedException \Box\Spout\Common\Exception\IOException
*
* @param string $filePath
* @return void
*/
public function testReadShouldThrowException($filePath)
{
$this->expectException(IOException::class);
// using @ to prevent warnings/errors from being displayed
@$this->getAllRowsForFile($filePath);
}
@@ -568,24 +569,24 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException \Box\Spout\Common\Exception\IOException
*
* @return void
*/
public function testReadWithUnsupportedCustomStreamWrapper()
{
$this->expectException(IOException::class);
/** @var \Box\Spout\Reader\XLSX\Reader $reader */
$reader = ReaderFactory::create(Type::XLSX);
$reader->open('unsupported://foobar');
}
/**
* @expectedException \Box\Spout\Common\Exception\IOException
*
* @return void
*/
public function testReadWithSupportedCustomStreamWrapper()
{
$this->expectException(IOException::class);
/** @var \Box\Spout\Reader\XLSX\Reader $reader */
$reader = ReaderFactory::create(Type::XLSX);
$reader->open('php://memory');