upgrades core to 8.4.2
This commit is contained in:
+3
-3
@@ -8,8 +8,8 @@ dependencies:
|
||||
- contact
|
||||
- user
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-08-16
|
||||
version: '8.3.7'
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1502903957
|
||||
datestamp: 1509719929
|
||||
|
||||
@@ -7,8 +7,8 @@ package: Testing
|
||||
dependencies:
|
||||
- contact
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-08-16
|
||||
version: '8.3.7'
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1502903957
|
||||
datestamp: 1509719929
|
||||
|
||||
@@ -9,8 +9,8 @@ dependencies:
|
||||
- views
|
||||
- user
|
||||
|
||||
# Information added by Drupal.org packaging script on 2017-08-16
|
||||
version: '8.3.7'
|
||||
# Information added by Drupal.org packaging script on 2017-11-03
|
||||
version: '8.4.2'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1502903957
|
||||
datestamp: 1509719929
|
||||
|
||||
@@ -6,8 +6,8 @@ use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Component\Render\PlainTextOutput;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\Core\Test\AssertMailTrait;
|
||||
use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait;
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait;
|
||||
use Drupal\user\RoleInterface;
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ class ContactPersonalTest extends BrowserTestBase {
|
||||
$this->drupalGet('user/' . $this->contactUser->id());
|
||||
$contact_link = '/user/' . $this->contactUser->id() . '/contact';
|
||||
$this->assertResponse(200);
|
||||
$this->assertNoLinkByHref ($contact_link, 'The "contact" tab is hidden on profiles for users with no email address');
|
||||
$this->assertNoLinkByHref($contact_link, 'The "contact" tab is hidden on profiles for users with no email address');
|
||||
|
||||
// Restore original email address.
|
||||
$this->contactUser->setEmail($original_email)->save();
|
||||
|
||||
@@ -44,6 +44,27 @@ class ContactSitewideTest extends BrowserTestBase {
|
||||
* Tests configuration options and the site-wide contact form.
|
||||
*/
|
||||
public function testSiteWideContact() {
|
||||
// Tests name and email fields for authenticated and anonymous users.
|
||||
$this->drupalLogin($this->drupalCreateUser(['access site-wide contact form']));
|
||||
$this->drupalGet('contact');
|
||||
|
||||
// Ensure that there is no textfield for name.
|
||||
$this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'name']));
|
||||
|
||||
// Ensure that there is no textfield for email.
|
||||
$this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'mail']));
|
||||
|
||||
// Logout and retrieve the page as an anonymous user
|
||||
$this->drupalLogout();
|
||||
user_role_grant_permissions('anonymous', ['access site-wide contact form']);
|
||||
$this->drupalGet('contact');
|
||||
|
||||
// Ensure that there is textfield for name.
|
||||
$this->assertTrue($this->xpath('//input[@name=:name]', [':name' => 'name']));
|
||||
|
||||
// Ensure that there is textfield for email.
|
||||
$this->assertTrue($this->xpath('//input[@name=:name]', [':name' => 'mail']));
|
||||
|
||||
// Create and log in administrative user.
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access site-wide contact form',
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Tests\contact\Functional\Update;
|
||||
|
||||
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
|
||||
|
||||
/**
|
||||
* Tests contact update path.
|
||||
*
|
||||
* @group contact
|
||||
*/
|
||||
class ContactUpdateTest extends UpdatePathTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setDatabaseDumpFiles() {
|
||||
$this->databaseDumpFiles = [
|
||||
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests contact_form updates.
|
||||
*
|
||||
* @see contact_post_update_add_message_redirect_field_to_contact_form()
|
||||
*/
|
||||
public function testPostUpdateContactFormFields() {
|
||||
// Check that contact_form does not have fields redirect and message.
|
||||
$config_factory = \Drupal::configFactory();
|
||||
// Check that contact_form entities are more than zero.
|
||||
$contact_forms = $config_factory->listAll('contact.form.');
|
||||
$this->assertTrue(count($contact_forms), 'There are contact forms to update.');
|
||||
foreach ($contact_forms as $contact_config_name) {
|
||||
$contact_form_data = $config_factory->get($contact_config_name)->get();
|
||||
$this->assertFalse(isset($contact_form_data['message']), 'Prior to running the update the "message" key does not exist.');
|
||||
$this->assertFalse(isset($contact_form_data['redirect']), 'Prior to running the update the "redirect" key does not exist.');
|
||||
}
|
||||
|
||||
// Run updates.
|
||||
$this->runUpdates();
|
||||
|
||||
// Check that the contact_form entities have been updated.
|
||||
foreach ($contact_forms as $contact_config_name) {
|
||||
$contact_form_data = $config_factory->get($contact_config_name)->get();
|
||||
$this->assertTrue(isset($contact_form_data['message']), 'After running the update the "message" key exists.');
|
||||
$this->assertEqual('Your message has been sent.', $contact_form_data['message']);
|
||||
$this->assertTrue(isset($contact_form_data['redirect']), 'After running the update the "redirect" key exists.');
|
||||
$this->assertEqual('', $contact_form_data['redirect']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class MailHandlerTest extends UnitTestCase {
|
||||
$this->mailManager->expects($this->any())
|
||||
->method('mail')
|
||||
->willReturnCallback(
|
||||
function($module, $key, $to, $langcode, $params, $from) use (&$results) {
|
||||
function ($module, $key, $to, $langcode, $params, $from) use (&$results) {
|
||||
$result = array_shift($results);
|
||||
$this->assertEquals($module, $result['module']);
|
||||
$this->assertEquals($key, $result['key']);
|
||||
@@ -234,7 +234,7 @@ class MailHandlerTest extends UnitTestCase {
|
||||
$results[] = $result + $default_result;
|
||||
$data[] = [$message, $sender, $results];
|
||||
|
||||
//For authenticated user.
|
||||
// For authenticated user.
|
||||
$results = [];
|
||||
$message = $this->getAuthenticatedMockMessage();
|
||||
$sender = $this->getMockSender(FALSE, 'user@drupal.org');
|
||||
|
||||
Reference in New Issue
Block a user