Issue #2072597 by stevepurkiss, giffenk, legolasbo, bogdan khrupa, er.pushpinderrana, connorwk, damiankloip, amitgoyal, martin107, joshi.rohit100, jgeryk, jvranckx, stuti.manandhar, tkuldeep17, anish.a: Remove Unused local variables from tests in the Views module

8.0.x
Alex Pott 2015-09-26 16:21:01 +02:00
parent f801536d97
commit 1c9d1062dc
2 changed files with 6 additions and 6 deletions

View File

@ -41,6 +41,7 @@ class StyleUnformattedTest extends StyleTestBase {
$class = (string) $attributes['class'][0]; $class = (string) $attributes['class'][0];
$this->assertTrue(strpos($class, 'views-row') !== FALSE, 'Make sure that the views row class is set right.'); $this->assertTrue(strpos($class, 'views-row') !== FALSE, 'Make sure that the views row class is set right.');
} }
$this->assertIdentical($count, $count_result);
} }
} }

View File

@ -64,7 +64,7 @@ class RouteSubscriberTest extends UnitTestCase {
* @covers ::routeRebuildFinished * @covers ::routeRebuildFinished
*/ */
public function testRouteRebuildFinished() { public function testRouteRebuildFinished() {
list($view, $executable, $display_1, $display_2) = $this->setupMocks(); list($display_1, $display_2) = $this->setupMocks();
$display_1->expects($this->once()) $display_1->expects($this->once())
->method('collectRoutes') ->method('collectRoutes')
@ -95,7 +95,7 @@ class RouteSubscriberTest extends UnitTestCase {
$route_event = new RouteBuildEvent($collection, 'views'); $route_event = new RouteBuildEvent($collection, 'views');
list($view, $executable, $display_1, $display_2) = $this->setupMocks(); list($display_1, $display_2) = $this->setupMocks();
// The page_1 display overrides an existing route, so the dynamicRoutes // The page_1 display overrides an existing route, so the dynamicRoutes
// should only call the second display. // should only call the second display.
@ -139,9 +139,8 @@ class RouteSubscriberTest extends UnitTestCase {
/** /**
* Sets up mocks of Views objects needed for testing. * Sets up mocks of Views objects needed for testing.
* *
* @return array * @return array \Drupal\views\Plugin\views\display\DisplayRouterInterface[]|\PHPUnit_Framework_MockObject_MockObject[]
* An array of Views mocks, including the executable, the view entity, and * An array of two mocked view displays
* two display plugins.
*/ */
protected function setupMocks() { protected function setupMocks() {
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable') $executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
@ -190,7 +189,7 @@ class RouteSubscriberTest extends UnitTestCase {
$this->routeSubscriber->applicableViews[] = array('test_id', 'page_2'); $this->routeSubscriber->applicableViews[] = array('test_id', 'page_2');
$this->routeSubscriber->applicableViews[] = array('test_id', 'page_3'); $this->routeSubscriber->applicableViews[] = array('test_id', 'page_3');
return array($executable, $view, $display_1, $display_2); return array($display_1, $display_2);
} }
} }