Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
doSetTargetPath example
class
TargetPathTraitTest
extends
TestCase
{
public
function
testSetTargetPath
(
)
{
$obj
=
new
TestClassWithTargetPathTrait
(
)
;
$session
=
$this
->
createMock
(
SessionInterface::
class
)
;
$session
->
expects
(
$this
->
once
(
)
)
->
method
(
'set'
)
->
with
(
'_security.firewall_name.target_path', '/foo'
)
;
$obj
->
doSetTargetPath
(
$session
, 'firewall_name', '/foo'
)
;
}
public
function
testGetTargetPath
(
)
{
$obj
=
new
TestClassWithTargetPathTrait
(
)
;
$session
=
$this
->
createMock
(
SessionInterface::
class
)
;
$session
->
expects
(
$this
->
once
(
)
)
->
method
(
'get'
)
->
with
(
'_security.cool_firewall.target_path'
)
->
willReturn
(
'/bar'
)
;