Update to Drupal 8.0.2. For more information, see https://www.drupal.org/drupal-8.0.2-release-notes
This commit is contained in:
parent
1a0e9d9fac
commit
a6b049dd05
538 changed files with 5247 additions and 1594 deletions
|
@ -135,7 +135,7 @@ class ResultTest extends UnitTestCase {
|
|||
$this->view->pager = $pager;
|
||||
$this->view->style_plugin = new \stdClass();
|
||||
$this->view->total_rows = 100;
|
||||
$this->view->result = array(1,2,3,4,5);
|
||||
$this->view->result = array(1, 2, 3, 4, 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -260,6 +260,44 @@ class PathPluginBaseTest extends UnitTestCase {
|
|||
$this->assertSame($collection->get('test_route_2'), $route_2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the alter route method with preexisting title callback.
|
||||
*/
|
||||
public function testAlterRouteWithAlterCallback() {
|
||||
$collection = new RouteCollection();
|
||||
$collection->add('test_route', new Route('test_route', array('_controller' => 'Drupal\Tests\Core\Controller\TestController::content', '_title_callback' => '\Drupal\Tests\views\Unit\Plugin\display\TestController::testTitle')));
|
||||
$route_2 = new Route('test_route/example', array('_controller' => 'Drupal\Tests\Core\Controller\TestController::content'));
|
||||
$collection->add('test_route_2', $route_2);
|
||||
|
||||
list($view) = $this->setupViewExecutableAccessPlugin();
|
||||
|
||||
$display = array();
|
||||
$display['display_plugin'] = 'page';
|
||||
$display['id'] = 'page_1';
|
||||
$display['display_options'] = array(
|
||||
'path' => 'test_route',
|
||||
);
|
||||
$this->pathPlugin->initDisplay($view, $display);
|
||||
|
||||
$view_route_names = $this->pathPlugin->alterRoutes($collection);
|
||||
$this->assertEquals(array('test_id.page_1' => 'test_route'), $view_route_names);
|
||||
|
||||
// Ensure that the test_route is overridden.
|
||||
$route = $collection->get('test_route');
|
||||
$this->assertTrue($route instanceof Route);
|
||||
$this->assertEquals('test_id', $route->getDefault('view_id'));
|
||||
$this->assertEquals('\Drupal\Tests\views\Unit\Plugin\display\TestController::testTitle', $route->getDefault('_title_callback'));
|
||||
$this->assertEquals('page_1', $route->getDefault('display_id'));
|
||||
$this->assertEquals('my views title', $route->getDefault('_title'));
|
||||
|
||||
// Ensure that the test_route_2 is not overridden.
|
||||
$route = $collection->get('test_route_2');
|
||||
$this->assertTrue($route instanceof Route);
|
||||
$this->assertFalse($route->hasDefault('view_id'));
|
||||
$this->assertFalse($route->hasDefault('display_id'));
|
||||
$this->assertSame($collection->get('test_route_2'), $route_2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the collectRoutes method with a path containing named parameters.
|
||||
*
|
||||
|
@ -457,3 +495,20 @@ class PathPluginBaseTest extends UnitTestCase {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A page controller for use by tests in this file.
|
||||
*/
|
||||
class TestController {
|
||||
|
||||
/**
|
||||
* A page title callback.
|
||||
*
|
||||
* @return string
|
||||
* The page title.
|
||||
*/
|
||||
public function testTitle() {
|
||||
return 'Test title';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class EntityOperationsUnitTest extends UnitTestCase {
|
|||
*
|
||||
* @covers ::__construct
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
$this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
|
||||
$this->languageManager = $this->getMock('\Drupal\Core\Language\LanguageManagerInterface');
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class ViewsHandlerManagerTest extends UnitTestCase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
$this->viewsData = $this->getMockBuilder('Drupal\views\ViewsData')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
|
Reference in a new issue