File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
app/code/Magento/Csp/Test/Unit/Model Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 20
20
use RuntimeException ;
21
21
22
22
/**
23
- * Class ConfigManagerTest
24
- *
25
23
* Test for \Magento\Csp\Model\Mode\ConfigManager
26
24
*/
27
25
class ConfigManagerTest extends TestCase
@@ -71,16 +69,16 @@ protected function setUp()
71
69
* Test throwing an exception for non storefront or admin areas
72
70
*
73
71
* @return void
74
- *
75
- * @expectedExceptionMessage CSP can only be configured for storefront or admin area
76
- * @expectedException RuntimeException
77
72
*/
78
73
public function testThrownExceptionForCrontabArea ()
79
74
{
80
75
$ this ->stateMock ->expects ($ this ->any ())
81
76
->method ('getAreaCode ' )
82
77
->willReturn (Area::AREA_CRONTAB );
83
78
79
+ $ this ->expectExceptionMessage ('CSP can only be configured for storefront or admin area ' );
80
+ $ this ->expectException (RuntimeException::class);
81
+
84
82
$ this ->model ->getConfigured ();
85
83
}
86
84
Original file line number Diff line number Diff line change 17
17
use RuntimeException ;
18
18
19
19
/**
20
- * Class PolicyRendererPoolTest
21
- *
22
20
* Test for \Magento\Csp\Model\PolicyRendererPool
23
21
*/
24
22
class PolicyRendererPoolTest extends TestCase
@@ -66,16 +64,16 @@ protected function setUp()
66
64
* Test throwing an exception for not found policy renders
67
65
*
68
66
* @return void
69
- *
70
- * @expectedExceptionMessage Failed to find a renderer for policy
71
- * @expectedException RuntimeException
72
67
*/
73
68
public function testThrownExceptionForNotFoundPolicyRenders ()
74
69
{
75
70
$ this ->policyMock ->expects ($ this ->any ())
76
71
->method ('getId ' )
77
72
->willReturn (static ::STUB_POLICY_ID );
78
73
74
+ $ this ->expectExceptionMessage ('Failed to find a renderer for policy ' );
75
+ $ this ->expectException (RuntimeException::class);
76
+
79
77
$ this ->model ->getRenderer ($ this ->policyMock );
80
78
}
81
79
You can’t perform that action at this time.
0 commit comments