Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
e5193db4
Unverified
Commit
e5193db4
authored
Jun 13, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename setExpectedException to expectException for phpunit compatibility
parent
098590d2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
15 deletions
+20
-15
AsgardAssetManagerTest.php
Modules/Core/Tests/Asset/AsgardAssetManagerTest.php
+2
-2
AsgardAssetPipelineTest.php
Modules/Core/Tests/Asset/AsgardAssetPipelineTest.php
+2
-2
AssetFactoryTest.php
Modules/Core/Tests/Asset/AssetFactoryTest.php
+1
-1
MediaPathTest.php
Modules/Media/Tests/MediaPathTest.php
+2
-2
ModuleScaffoldTest.php
Modules/Workshop/Tests/ModuleScaffoldTest.php
+5
-3
ThemeScaffoldTest.php
Modules/Workshop/Tests/ThemeScaffoldTest.php
+8
-5
No files found.
Modules/Core/Tests/Asset/AsgardAssetManagerTest.php
View file @
e5193db4
...
...
@@ -83,7 +83,7 @@ class AsgardAssetManagerTest extends BaseTestCase
/** @test */
public
function
it_should_throw_an_exception_if_js_asset_not_found
()
{
$this
->
setExpected
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
expect
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
assetManager
->
addAsset
(
'jquery'
,
'/path/to/jquery.js'
);
...
...
@@ -93,7 +93,7 @@ class AsgardAssetManagerTest extends BaseTestCase
/** @test */
public
function
it_should_throw_an_exception_if_css_asset_not_found
()
{
$this
->
setExpected
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
expect
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
assetManager
->
addAsset
(
'main'
,
'/path/to/main.css'
);
...
...
Modules/Core/Tests/Asset/AsgardAssetPipelineTest.php
View file @
e5193db4
...
...
@@ -66,7 +66,7 @@ class AsgardAssetPipelineTest extends BaseTestCase
/** @test */
public
function
it_should_throw_an_exception_if_js_asset_not_found
()
{
$this
->
setExpected
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
expect
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
assetManager
->
addAsset
(
'jquery'
,
'/path/to/jquery.js'
);
...
...
@@ -76,7 +76,7 @@ class AsgardAssetPipelineTest extends BaseTestCase
/** @test */
public
function
it_should_throw_an_exception_if_css_asset_not_found
()
{
$this
->
setExpected
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
expect
Exception
(
'Modules\Core\Foundation\Asset\AssetNotFoundException'
);
$this
->
assetManager
->
addAsset
(
'main'
,
'/path/to/main.css'
);
...
...
Modules/Core/Tests/Asset/AssetFactoryTest.php
View file @
e5193db4
...
...
@@ -23,7 +23,7 @@ class AssetFactoryTest extends BaseTestCase
/** @test */
public
function
it_throws_exception_if_asset_type_not_found
()
{
$this
->
setExpected
Exception
(
\InvalidArgumentException
::
class
);
$this
->
expect
Exception
(
\InvalidArgumentException
::
class
);
$path
=
[
'somehting'
=>
'some/path.something'
];
...
...
Modules/Media/Tests/MediaPathTest.php
View file @
e5193db4
...
...
@@ -15,9 +15,9 @@ class MediaPathTest extends \PHPUnit_Framework_TestCase
}
/** @test */
public
function
it_only_acepts_a_string_as_argument
()
public
function
it_only_ac
c
epts_a_string_as_argument
()
{
$this
->
setExpected
Exception
(
\InvalidArgumentException
::
class
);
$this
->
expect
Exception
(
\InvalidArgumentException
::
class
);
new
MediaPath
([
'something'
]);
}
...
...
Modules/Workshop/Tests/ModuleScaffoldTest.php
View file @
e5193db4
...
...
@@ -2,6 +2,7 @@
namespace
Modules\Workshop\Tests
;
use
Modules\Workshop\Scaffold\Module\Exception\ModuleExistsException
;
use
Modules\Workshop\Scaffold\Module\ModuleScaffold
;
class
ModuleScaffoldTest
extends
BaseTestCase
...
...
@@ -85,7 +86,7 @@ class ModuleScaffoldTest extends BaseTestCase
* @param $type
* @param $entities
* @param $valueObjects
* @throws
\Modules\Workshop\Scaffold\Module\Exception\
ModuleExistsException
* @throws ModuleExistsException
*/
private
function
scaffoldModule
(
$type
,
$entities
,
$valueObjects
)
{
...
...
@@ -348,14 +349,15 @@ class ModuleScaffoldTest extends BaseTestCase
$this
->
cleanUp
();
}
/** @test */
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
->
assertEquals
(
'Modules\Workshop\Scaffold\Exception\ModuleExistsException'
,
$this
->
getExpectedException
());
$this
->
assertEquals
(
ModuleExistsException
::
class
,
$this
->
getExpectedException
());
}
/** @test */
...
...
Modules/Workshop/Tests/ThemeScaffoldTest.php
View file @
e5193db4
...
...
@@ -66,7 +66,7 @@ class ThemeScaffoldTest extends BaseTestCase
{
$this
->
scaffold
->
setFiles
([
'OneTwoThree'
]);
$this
->
setExpected
Exception
(
FileTypeNotFoundException
::
class
);
$this
->
expect
Exception
(
FileTypeNotFoundException
::
class
);
$this
->
generateFrontendTheme
();
}
...
...
@@ -74,7 +74,7 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */
public
function
it_throws_exception_if_theme_exists
()
{
$this
->
setExpected
Exception
(
ThemeExistsException
::
class
);
$this
->
expect
Exception
(
ThemeExistsException
::
class
);
$this
->
scaffold
->
setFiles
([]);
$this
->
generateFrontendTheme
();
...
...
@@ -84,7 +84,8 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */
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
();
}
...
...
@@ -92,7 +93,8 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */
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
();
}
...
...
@@ -100,7 +102,8 @@ class ThemeScaffoldTest extends BaseTestCase
/** @test */
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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment