Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setupFactory example
public
function
testGetLocalTasksForRouteSingleLevelTitle
(
)
{
$definitions
=
$this
->
getLocalTaskFixtures
(
)
;
$this
->pluginDiscovery->
expects
(
$this
->
once
(
)
)
->
method
(
'getDefinitions'
)
->
willReturn
(
$definitions
)
;
$mock_plugin
=
$this
->
createMock
(
'Drupal\Core\Menu\LocalTaskInterface'
)
;
$this
->
setupFactory
(
$mock_plugin
)
;
$this
->
setupLocalTaskManager
(
)
;
$local_tasks
=
$this
->manager->
getLocalTasksForRoute
(
'menu_local_task_test_tasks_view'
)
;
$result
=
$this
->
getLocalTasksForRouteResult
(
$mock_plugin
)
;
$this
->
assertEquals
(
$result
,
$local_tasks
)
;
}
/** * Tests the getLocalTasksForRoute method on a child. * * @see \Drupal\system\Plugin\Type\MenuLocalTaskManager::getLocalTasksForRoute() */