Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
hasMatchingRoute example
public
function
testHasMatchingRoute
(
$routes
,
$route_name
,
$route_params
,
$result
)
{
$tour
=
$this
->
getMockBuilder
(
'\Drupal\tour\Entity\Tour'
)
->
disableOriginalConstructor
(
)
->
onlyMethods
(
[
'getRoutes'
]
)
->
getMock
(
)
;
$tour
->
expects
(
$this
->
any
(
)
)
->
method
(
'getRoutes'
)
->
willReturn
(
$routes
)
;
$this
->
assertSame
(
$result
,
$tour
->
hasMatchingRoute
(
$route_name
,
$route_params
)
)
;
$tour
->
resetKeyedRoutes
(
)
;
}
/** * Provides sample routes for testing. */
public
function
routeProvider
(
)
{
return
[
// Simple match.
[
[