Remove @expectedException annotation
This commit is contained in:
1 parent
7274226b75
commit
3851e05f83
20 files changed
+173
-74
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Box\Spout\Common\Helper;
|
||||
|
||||
use Box\Spout\Common\Exception\EncodingConversionException;
|
||||
use Box\Spout\TestUsingResource;
|
||||
|
||||
/**
|
||||
@@ -57,13 +58,14 @@ class EncodingHelperTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider dataProviderForIconvOrMbstringUsage
|
||||
* @expectedException \Box\Spout\Common\Exception\EncodingConversionException
|
||||
*
|
||||
* @param bool $shouldUseIconv
|
||||
* @return void
|
||||
*/
|
||||
public function testAttemptConversionToUTF8ShouldThrowIfConversionFailed($shouldUseIconv)
|
||||
{
|
||||
$this->expectException(EncodingConversionException::class);
|
||||
|
||||
$helperStub = $this->getMockBuilder('\Box\Spout\Common\Helper\GlobalFunctionsHelper')
|
||||
->setMethods(['iconv', 'mb_convert_encoding'])
|
||||
->getMock();
|
||||
@@ -82,12 +84,12 @@ class EncodingHelperTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Box\Spout\Common\Exception\EncodingConversionException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAttemptConversionToUTF8ShouldThrowIfConversionNotSupported()
|
||||
{
|
||||
$this->expectException(EncodingConversionException::class);
|
||||
|
||||
/** @var EncodingHelper $encodingHelperStub */
|
||||
$encodingHelperStub = $this->getMockBuilder('\Box\Spout\Common\Helper\EncodingHelper')
|
||||
->disableOriginalConstructor()
|
||||
@@ -139,13 +141,14 @@ class EncodingHelperTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider dataProviderForIconvOrMbstringUsage
|
||||
* @expectedException \Box\Spout\Common\Exception\EncodingConversionException
|
||||
*
|
||||
* @param bool $shouldUseIconv
|
||||
* @return void
|
||||
*/
|
||||
public function testAttemptConversionFromUTF8ShouldThrowIfConversionFailed($shouldUseIconv)
|
||||
{
|
||||
$this->expectException(EncodingConversionException::class);
|
||||
|
||||
$helperStub = $this->getMockBuilder('\Box\Spout\Common\Helper\GlobalFunctionsHelper')
|
||||
->setMethods(['iconv', 'mb_convert_encoding'])
|
||||
->getMock();
|
||||
@@ -164,12 +167,12 @@ class EncodingHelperTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Box\Spout\Common\Exception\EncodingConversionException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAttemptConversionFromUTF8ShouldThrowIfConversionNotSupported()
|
||||
{
|
||||
$this->expectException(EncodingConversionException::class);
|
||||
|
||||
/** @var EncodingHelper $encodingHelperStub */
|
||||
$encodingHelperStub = $this->getMockBuilder('\Box\Spout\Common\Helper\EncodingHelper')
|
||||
->disableOriginalConstructor()
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace Box\Spout\Common\Helper;
|
||||
|
||||
use Box\Spout\Common\Exception\IOException;
|
||||
|
||||
/**
|
||||
* Class FileSystemHelperTest
|
||||
*/
|
||||
class FileSystemHelperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @var \Box\Spout\Writer\Helper\XLSX\FileSystemHelper */
|
||||
/** @var \Box\Spout\Writer\XLSX\Helper\FileSystemHelper */
|
||||
protected $fileSystemHelper;
|
||||
|
||||
/**
|
||||
@@ -20,38 +22,42 @@ class FileSystemHelperTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Box\Spout\Common\Exception\IOException
|
||||
* @return void
|
||||
*/
|
||||
public function testCreateFolderShouldThrowExceptionIfOutsideOfBaseFolder()
|
||||
{
|
||||
$this->expectException(IOException::class);
|
||||
|
||||
$this->fileSystemHelper->createFolder('/tmp/folder_outside_base_folder', 'folder_name');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Box\Spout\Common\Exception\IOException
|
||||
* @return void
|
||||
*/
|
||||
public function testCreateFileWithContentsShouldThrowExceptionIfOutsideOfBaseFolder()
|
||||
{
|
||||
$this->expectException(IOException::class);
|
||||
|
||||
$this->fileSystemHelper->createFileWithContents('/tmp/folder_outside_base_folder', 'file_name', 'contents');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Box\Spout\Common\Exception\IOException
|
||||
* @return void
|
||||
*/
|
||||
public function testDeleteFileShouldThrowExceptionIfOutsideOfBaseFolder()
|
||||
{
|
||||
$this->expectException(IOException::class);
|
||||
|
||||
$this->fileSystemHelper->deleteFile('/tmp/folder_outside_base_folder/file_name');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Box\Spout\Common\Exception\IOException
|
||||
* @return void
|
||||
*/
|
||||
public function testDeleteFolderRecursivelyShouldThrowExceptionIfOutsideOfBaseFolder()
|
||||
{
|
||||
$this->expectException(IOException::class);
|
||||
|
||||
$this->fileSystemHelper->deleteFolderRecursively('/tmp/folder_outside_base_folder');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user