Rename setExpectedException to expectException for phpunit compatibility

parent 098590d2
...@@ -83,7 +83,7 @@ class AsgardAssetManagerTest extends BaseTestCase ...@@ -83,7 +83,7 @@ class AsgardAssetManagerTest extends BaseTestCase
/** @test */ /** @test */
public function it_should_throw_an_exception_if_js_asset_not_found() public function it_should_throw_an_exception_if_js_asset_not_found()
{ {
$this->setExpectedException('Modules\Core\Foundation\Asset\AssetNotFoundException'); $this->expectException('Modules\Core\Foundation\Asset\AssetNotFoundException');
$this->assetManager->addAsset('jquery', '/path/to/jquery.js'); $this->assetManager->addAsset('jquery', '/path/to/jquery.js');
...@@ -93,7 +93,7 @@ class AsgardAssetManagerTest extends BaseTestCase ...@@ -93,7 +93,7 @@ class AsgardAssetManagerTest extends BaseTestCase
/** @test */ /** @test */
public function it_should_throw_an_exception_if_css_asset_not_found() public function it_should_throw_an_exception_if_css_asset_not_found()
{ {
$this->setExpectedException('Modules\Core\Foundation\Asset\AssetNotFoundException'); $this->expectException('Modules\Core\Foundation\Asset\AssetNotFoundException');
$this->assetManager->addAsset('main', '/path/to/main.css'); $this->assetManager->addAsset('main', '/path/to/main.css');
......
...@@ -66,7 +66,7 @@ class AsgardAssetPipelineTest extends BaseTestCase ...@@ -66,7 +66,7 @@ class AsgardAssetPipelineTest extends BaseTestCase
/** @test */ /** @test */
public function it_should_throw_an_exception_if_js_asset_not_found() public function it_should_throw_an_exception_if_js_asset_not_found()
{ {
$this->setExpectedException('Modules\Core\Foundation\Asset\AssetNotFoundException'); $this->expectException('Modules\Core\Foundation\Asset\AssetNotFoundException');
$this->assetManager->addAsset('jquery', '/path/to/jquery.js'); $this->assetManager->addAsset('jquery', '/path/to/jquery.js');
...@@ -76,7 +76,7 @@ class AsgardAssetPipelineTest extends BaseTestCase ...@@ -76,7 +76,7 @@ class AsgardAssetPipelineTest extends BaseTestCase
/** @test */ /** @test */
public function it_should_throw_an_exception_if_css_asset_not_found() public function it_should_throw_an_exception_if_css_asset_not_found()
{ {
$this->setExpectedException('Modules\Core\Foundation\Asset\AssetNotFoundException'); $this->expectException('Modules\Core\Foundation\Asset\AssetNotFoundException');
$this->assetManager->addAsset('main', '/path/to/main.css'); $this->assetManager->addAsset('main', '/path/to/main.css');
......
...@@ -23,7 +23,7 @@ class AssetFactoryTest extends BaseTestCase ...@@ -23,7 +23,7 @@ class AssetFactoryTest extends BaseTestCase
/** @test */ /** @test */
public function it_throws_exception_if_asset_type_not_found() public function it_throws_exception_if_asset_type_not_found()
{ {
$this->setExpectedException(\InvalidArgumentException::class); $this->expectException(\InvalidArgumentException::class);
$path = ['somehting' => 'some/path.something']; $path = ['somehting' => 'some/path.something'];
......
...@@ -15,9 +15,9 @@ class MediaPathTest extends \PHPUnit_Framework_TestCase ...@@ -15,9 +15,9 @@ class MediaPathTest extends \PHPUnit_Framework_TestCase
} }
/** @test */ /** @test */
public function it_only_acepts_a_string_as_argument() public function it_only_accepts_a_string_as_argument()
{ {
$this->setExpectedException(\InvalidArgumentException::class); $this->expectException(\InvalidArgumentException::class);
new MediaPath(['something']); new MediaPath(['something']);
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Modules\Workshop\Tests; namespace Modules\Workshop\Tests;
use Modules\Workshop\Scaffold\Module\Exception\ModuleExistsException;
use Modules\Workshop\Scaffold\Module\ModuleScaffold; use Modules\Workshop\Scaffold\Module\ModuleScaffold;
class ModuleScaffoldTest extends BaseTestCase class ModuleScaffoldTest extends BaseTestCase
...@@ -85,7 +86,7 @@ class ModuleScaffoldTest extends BaseTestCase ...@@ -85,7 +86,7 @@ class ModuleScaffoldTest extends BaseTestCase
* @param $type * @param $type
* @param $entities * @param $entities
* @param $valueObjects * @param $valueObjects
* @throws \Modules\Workshop\Scaffold\Module\Exception\ModuleExistsException * @throws ModuleExistsException
*/ */
private function scaffoldModule($type, $entities, $valueObjects) private function scaffoldModule($type, $entities, $valueObjects)
{ {
...@@ -348,14 +349,15 @@ class ModuleScaffoldTest extends BaseTestCase ...@@ -348,14 +349,15 @@ class ModuleScaffoldTest extends BaseTestCase
$this->cleanUp(); $this->cleanUp();
} }
/** @test */
public function it_should_throw_exception_if_module_exists() public function it_should_throw_exception_if_module_exists()
{ {
$this->setExpectedException('Modules\Workshop\Scaffold\Exception\ModuleExistsException'); $this->expectException(ModuleExistsException::class);
$this->scaffoldModuleWithEloquent(); $this->scaffoldModuleWithEloquent();
$this->scaffoldModuleWithEloquent(); $this->scaffoldModuleWithEloquent();
$this->assertEquals('Modules\Workshop\Scaffold\Exception\ModuleExistsException', $this->getExpectedException()); $this->assertEquals(ModuleExistsException::class, $this->getExpectedException());
} }
/** @test */ /** @test */
......
...@@ -66,7 +66,7 @@ class ThemeScaffoldTest extends BaseTestCase ...@@ -66,7 +66,7 @@ class ThemeScaffoldTest extends BaseTestCase
{ {
$this->scaffold->setFiles(['OneTwoThree']); $this->scaffold->setFiles(['OneTwoThree']);
$this->setExpectedException(FileTypeNotFoundException::class); $this->expectException(FileTypeNotFoundException::class);
$this->generateFrontendTheme(); $this->generateFrontendTheme();
} }
...@@ -74,7 +74,7 @@ class ThemeScaffoldTest extends BaseTestCase ...@@ -74,7 +74,7 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */ /** @test */
public function it_throws_exception_if_theme_exists() public function it_throws_exception_if_theme_exists()
{ {
$this->setExpectedException(ThemeExistsException::class); $this->expectException(ThemeExistsException::class);
$this->scaffold->setFiles([]); $this->scaffold->setFiles([]);
$this->generateFrontendTheme(); $this->generateFrontendTheme();
...@@ -84,7 +84,8 @@ class ThemeScaffoldTest extends BaseTestCase ...@@ -84,7 +84,8 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */ /** @test */
public function it_throws_exception_if_no_name_provided() public function it_throws_exception_if_no_name_provided()
{ {
$this->setExpectedException(\InvalidArgumentException::class, 'You must provide a name'); $this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('You must provide a name');
$this->scaffold->setName('')->forType('frontend')->setVendor('asgardcms')->generate(); $this->scaffold->setName('')->forType('frontend')->setVendor('asgardcms')->generate();
} }
...@@ -92,7 +93,8 @@ class ThemeScaffoldTest extends BaseTestCase ...@@ -92,7 +93,8 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */ /** @test */
public function it_throws_exception_if_no_type_provided() public function it_throws_exception_if_no_type_provided()
{ {
$this->setExpectedException(\InvalidArgumentException::class, 'You must provide a type'); $this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('You must provide a type');
$this->scaffold->setName($this->testThemeName)->forType('')->setVendor('asgardcms')->generate(); $this->scaffold->setName($this->testThemeName)->forType('')->setVendor('asgardcms')->generate();
} }
...@@ -100,7 +102,8 @@ class ThemeScaffoldTest extends BaseTestCase ...@@ -100,7 +102,8 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */ /** @test */
public function it_throws_exception_if_no_vendor_provided() public function it_throws_exception_if_no_vendor_provided()
{ {
$this->setExpectedException(\InvalidArgumentException::class, 'You must provide a vendor name'); $this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('You must provide a vendor name');
$this->scaffold->setName($this->testThemeName)->forType('frontend')->setVendor('')->generate(); $this->scaffold->setName($this->testThemeName)->forType('frontend')->setVendor('')->generate();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment