Skip to content
......@@ -19,7 +19,7 @@ class FieldCounterTest extends ViewUnitTestBase {
*
* @var array
*/
public static $modules = array('user', 'field');
public static $modules = array('user');
/**
* Views used by this test.
......@@ -36,12 +36,6 @@ public static function getInfo() {
);
}
protected function setUp() {
parent::setUp();
$this->installSchema('user', 'users');
}
function testSimple() {
$view = views_get_view('test_view');
$view->setDisplay();
......
......@@ -17,7 +17,7 @@
*/
class FieldUnitTest extends ViewUnitTestBase {
public static $modules = array('user', 'field');
public static $modules = array('user');
/**
* Views used by this test.
......@@ -38,12 +38,6 @@ public static function getInfo() {
);
}
protected function setUp() {
parent::setUp();
$this->installSchema('user', 'users');
}
/**
* Overrides Drupal\views\Tests\ViewTestBase::viewsData().
*/
......
......@@ -59,7 +59,6 @@ protected function setUp() {
// Setup the needed tables in order to make the drupal router working.
$this->installSchema('system', array('router', 'menu_router', 'url_alias'));
$this->installSchema('menu_link', 'menu_links');
$this->installSchema('user', 'users');
}
/**
......
......@@ -1302,6 +1302,8 @@ public function render($display_id = NULL) {
return;
}
drupal_theme_initialize();
$exposed_form = $this->display_handler->getPlugin('exposed_form');
$exposed_form->preRender($this->result);
......@@ -1363,14 +1365,12 @@ public function render($display_id = NULL) {
$module_handler->invokeAll('views_pre_render', array($this));
// Let the themes play too, because pre render is a very themey thing.
if (isset($GLOBALS['base_theme_info']) && isset($GLOBALS['theme'])) {
foreach ($GLOBALS['base_theme_info'] as $base) {
$module_handler->invoke($base, 'views_pre_render', array($this));
}
$module_handler->invoke($GLOBALS['theme'], 'views_pre_render', array($this));
foreach ($GLOBALS['base_theme_info'] as $base) {
$module_handler->invoke($base, 'views_pre_render', array($this));
}
$module_handler->invoke($GLOBALS['theme'], 'views_pre_render', array($this));
$this->display_handler->output = $this->display_handler->render();
if ($cache) {
$cache->cacheSet('output');
......@@ -1387,14 +1387,12 @@ public function render($display_id = NULL) {
$module_handler->invokeAll('views_post_render', array($this, &$this->display_handler->output, $cache));
// Let the themes play too, because post render is a very themey thing.
if (isset($GLOBALS['base_theme_info']) && isset($GLOBALS['theme'])) {
foreach ($GLOBALS['base_theme_info'] as $base) {
$module_handler->invoke($base, 'views_post_render', array($this));
}
$module_handler->invoke($GLOBALS['theme'], 'views_post_render', array($this));
foreach ($GLOBALS['base_theme_info'] as $base) {
$module_handler->invoke($base, 'views_post_render', array($this));
}
$module_handler->invoke($GLOBALS['theme'], 'views_post_render', array($this));
return $this->display_handler->output;
}
......
......@@ -246,6 +246,20 @@ function views_permission() {
);
}
/**
* Implement hook_menu().
*/
function views_menu() {
$items = array();
$items['views/ajax'] = array(
'title' => 'Views',
'theme callback' => 'ajax_base_page_theme',
'route_name' => 'views.ajax',
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Implement hook_menu_alter().
*/
......
......@@ -2,7 +2,5 @@ views.ajax:
path: '/views/ajax'
defaults:
_controller: '\Drupal\views\Controller\ViewAjaxController::ajaxView'
options:
_theme: ajax_base_page
requirements:
_access: 'TRUE'
<?php
/**
* @file
* Contains \Drupal\Core\Theme\ThemeNegotiatorTest.
*/
namespace Drupal\Tests\Core\Theme;
use Drupal\Core\Theme\ThemeNegotiator;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\HttpFoundation\Request;
/**
* Tests the theme negotiator.
*
* @see \Drupal\Core\Theme\ThemeNegotiator
*/
class ThemeNegotiatorTest extends UnitTestCase {
/**
* The mocked theme access checker.
*
* @var \Drupal\Core\Theme\ThemeAccessCheck|\PHPUnit_Framework_MockObject_MockObject
*/
protected $themeAccessCheck;
/**
* The actual tested theme negotiator.
*
* @var \Drupal\Core\Theme\ThemeNegotiator
*/
protected $themeNegotiator;
public static function getInfo() {
return array(
'name' => 'Theme negotiator',
'description' => 'Tests the theme negotiator.',
'group' => 'Theme',
);
}
protected function setUp() {
$this->themeAccessCheck = $this->getMockBuilder('\Drupal\Core\Theme\ThemeAccessCheck')
->disableOriginalConstructor()
->getMock();
$this->themeNegotiator = new ThemeNegotiator($this->themeAccessCheck);
}
/**
* Tests determining the theme.
*
* @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
*/
public function testDetermineActiveTheme() {
$negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
$negotiator->expects($this->once())
->method('determineActiveTheme')
->will($this->returnValue('example_test'));
$this->themeNegotiator->addNegotiator($negotiator, 0);
$this->themeAccessCheck->expects($this->any())
->method('checkAccess')
->will($this->returnValue(TRUE));
$request = Request::create('/test-route');
$theme = $this->themeNegotiator->determineActiveTheme($request);
$this->assertEquals('example_test', $theme);
$this->assertEquals('example_test', $request->attributes->get('_theme_active'));
}
/**
* Tests determining with two negotiators checking the priority.
*
* @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
*/
public function testDetermineActiveThemeWithPriority() {
$negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
$negotiator->expects($this->once())
->method('determineActiveTheme')
->will($this->returnValue('example_test'));
$this->themeNegotiator->addNegotiator($negotiator, 10);
$negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
$negotiator->expects($this->never())
->method('determineActiveTheme');
$this->themeNegotiator->addNegotiator($negotiator, 0);
$this->themeAccessCheck->expects($this->any())
->method('checkAccess')
->will($this->returnValue(TRUE));
$request = Request::create('/test-route');
$theme = $this->themeNegotiator->determineActiveTheme($request);
$this->assertEquals('example_test', $theme);
$this->assertEquals('example_test', $request->attributes->get('_theme_active'));
}
/**
* Tests determining with two negotiators of which just one returns access.
*
* @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
*/
public function testDetermineActiveThemeWithAccessCheck() {
$negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
$negotiator->expects($this->once())
->method('determineActiveTheme')
->will($this->returnValue('example_test'));
$this->themeNegotiator->addNegotiator($negotiator, 10);
$negotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
$negotiator->expects($this->once())
->method('determineActiveTheme')
->will($this->returnValue('example_test2'));
$this->themeNegotiator->addNegotiator($negotiator, 0);
$this->themeAccessCheck->expects($this->at(0))
->method('checkAccess')
->with('example_test')
->will($this->returnValue(FALSE));
$this->themeAccessCheck->expects($this->at(1))
->method('checkAccess')
->with('example_test2')
->will($this->returnValue(TRUE));
$request = Request::create('/test-route');
$theme = $this->themeNegotiator->determineActiveTheme($request);
$this->assertEquals('example_test2', $theme);
$this->assertEquals('example_test2', $request->attributes->get('_theme_active'));
}
}
......@@ -953,17 +953,17 @@ ul.links {
/* ------------------ Footer ------------------ */
#footer-wrapper {
#footer-wrapper .block .content {
color: #c0c0c0;
color: rgba(255, 255, 255, 0.65);
font-size: 0.857em;
}
#footer-wrapper a {
#footer-wrapper .block .content a {
color: #fcfcfc;
color: rgba(255, 255, 255, 0.8);
}
#footer-wrapper a:hover,
#footer-wrapper a:focus {
#footer-wrapper .block .content a:hover,
#footer-wrapper .block .content a:focus {
color: #fefefe;
color: rgba(255, 255, 255, 0.95);
text-decoration: underline;
......