diff --git a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php index bd4dc60..3fff782 100644 --- a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php +++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php @@ -37,44 +37,33 @@ public function testBuildRowEntityList() { ->disableOriginalConstructor() ->getMock(); + $definitions['default'] = array( + 'id' => 'default', + 'title' => 'Master', + 'theme' => 'views_view', + 'no_ui' => TRUE, + ); + $definitions['page'] = array( + 'id' => 'page', + 'title' => 'Page', + 'uses_hook_menu' => TRUE, + 'uses_route' => TRUE, + 'contextual_links_locations' => array('page'), + 'theme' => 'views_view', + 'admin' => 'Page admin label', + ); + $definitions['embed'] = array( + 'id' => 'embed', + 'title' => 'embed', + 'theme' => 'views_view', + 'admin' => 'Embed admin label', + ); $display_manager->expects($this->any()) ->method('getDefinition') - ->will($this->returnValueMap(array( - array( - 'default', - TRUE, - array( - 'id' => 'default', - 'title' => 'Master', - 'theme' => 'views_view', - 'no_ui' => TRUE, - ) - ), - array( - 'page', - TRUE, - array( - 'id' => 'page', - 'title' => 'Page', - 'uses_hook_menu' => TRUE, - 'uses_route' => TRUE, - 'contextual_links_locations' => array('page'), - 'theme' => 'views_view', - 'admin' => 'Page admin label', - ) - ), - array( - 'embed', - TRUE, - array( - 'id' => 'embed', - 'title' => 'embed', - 'theme' => 'views_view', - 'admin' => 'Embed admin label', - ) - ), - ))); - + ->with($this->isType('string'), $this->isType('bool')) + ->will($this->returnCallback(function ($plugin_id) use ($definitions) { + return $definitions[$plugin_id]; + })); $default_display = $this->getMock('Drupal\views\Plugin\views\display\DefaultDisplay', array('initDisplay'),