security updates of unpatched modules

This commit is contained in:
Bachir Soussi Chiadmi
2016-10-25 16:23:00 +02:00
parent 610760bedf
commit f6f7fd575f
133 changed files with 5598 additions and 2574 deletions

View File

@@ -0,0 +1,103 @@
<?php
/**
* @file
* Some rudimentary tests for entity handling, will be overridden by others.
*/
abstract class PanelsEntityViewWebTestCase extends DrupalWebTestCase {
/**
* Admin user.
*
* @var \StdClass
*/
protected $adminUser;
/**
* The task handler used for managing a specific entity type.
*
* @var \StdClass
*/
protected $view_name = 'node_view';
/**
* The label used for this entity's task handler.
*
* @var \StdClass
*/
protected $view_label = 'Node template';
/**
* {@inheritdoc}
*/
function setUp(array $modules = array()) {
$modules[] = 'panels';
$modules[] = 'page_manager';
parent::setUp($modules);
$permissions = array(
// Allow the user to access the Page Manager admin page.
'use page manager',
// Basic permissions for the module.
'use panels dashboard',
// General admin access.
'access administration pages',
);
// Reset the static variable used to identify permissions, otherwise it's
// possible the permissions check in drupalCreateUser will fail.
$this->checkPermissions(array(), TRUE);
cache_clear_all();
// Create the admin user.
$this->adminUser = $this->drupalCreateUser($permissions);
}
/**
* Ensure that the {ENTITY}_view toggle works correctly.
*/
function testToggle() {
// Log in as the admin user.
$this->drupalLogin($this->adminUser);
// Load the Panels dashboard.
$this->drupalGet('admin/structure/panels');
$this->assertResponse(200, 'Loaded the main Panels admin page.');
// Confirm that the Node View task handler is disabled.
$this->assertText(t($this->view_label));
$this->assertLinkByHref(url('admin/structure/pages/edit/' . $this->view_name, array('absolute' => FALSE)));
$xpath = $this->xpath("//tr[contains(@class,:tr)]/td/div/div/ul/li[contains(@class,:li)]/a", array(':tr' => 'page-task-' . $this->view_name, ':li' => 'first'));
$this->assertEqual($xpath[0][0], t('Enable'));
// Set the Node View handler to "off".
variable_set('page_manager_' . $this->view_name . '_disabled', TRUE);
// Load the Panels dashboard again.
$this->drupalGet('admin/structure/panels');
$this->assertResponse(200, 'Loaded the main Panels admin page.');
// Confirm that the Node View task handler is still disabled.
$this->assertText(t($this->view_label));
$this->assertNoLinkByHref(url('admin/structure/pages/nojs/disable/' . $this->view_name, array('absolute' => FALSE)));
$xpath = $this->xpath("//tr[contains(@class,:tr)]/td/div/div/ul/li[contains(@class,:li)]/a", array(':tr' => 'page-task-' . $this->view_name, ':li' => 'first'));
$this->assertEqual($xpath[0][0], t('Enable'));
// Set the Node View handler to "on".
variable_set('page_manager_' . $this->view_name . '_disabled', FALSE);
// Load the Panels dashboard again.
$this->drupalGet('admin/structure/panels');
$this->assertResponse(200, 'Loaded the main Panels admin page.');
// Confirm that the Node View task handler is now enabled.
$this->assertLinkByHref(url('admin/structure/pages/nojs/disable/' . $this->view_name, array('absolute' => FALSE)));
$xpath = $this->xpath("//tr[contains(@class,:tr)]/td/div/div/ul/li[contains(@class,:li)]/a", array(':tr' => 'page-task-' . $this->view_name, ':li' => 'last'));
$this->assertEqual($xpath[0][0], t('Disable'));
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* @file
* Some rudimentary tests for the node_view handler.
*/
class PanelsNodeViewWebTestCase extends PanelsEntityViewWebTestCase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'Panels node_view tests',
'description' => 'Test the standard node_view task handler.',
'group' => 'Panels',
);
}
/**
* {@inheritdoc}
*/
protected $view_name = 'node_view';
/**
* {@inheritdoc}
*/
protected $view_label = 'Node template';
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* @file
* Some rudimentary tests for the term_view handler.
*/
class PanelsTermViewWebTestCase extends PanelsEntityViewWebTestCase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'Panels term_view tests',
'description' => 'Test the standard term_view task handler.',
'group' => 'Panels',
);
}
/**
* {@inheritdoc}
*/
protected $view_name = 'term_view';
/**
* {@inheritdoc}
*/
protected $view_label = 'Taxonomy term template';
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* @file
* Some rudimentary tests for the user_view handler.
*/
class PanelsUserViewWebTestCase extends PanelsEntityViewWebTestCase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'Panels user_view tests',
'description' => 'Test the standard user_view task handler.',
'group' => 'Panels',
);
}
/**
* {@inheritdoc}
*/
protected $view_name = 'user_view';
/**
* {@inheritdoc}
*/
protected $view_label = 'Users';
}