Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713
This commit is contained in:
parent
c0a0d5a94c
commit
9eae24d844
669 changed files with 3873 additions and 1553 deletions
|
@ -153,7 +153,7 @@ class ForumTest extends WebTestBase {
|
|||
|
||||
$this->generateForumTopics();
|
||||
|
||||
// Login an unprivileged user to view the forum topics and generate an
|
||||
// Log in an unprivileged user to view the forum topics and generate an
|
||||
// active forum topics list.
|
||||
$this->drupalLogin($this->webUser);
|
||||
// Verify that this user is shown a message that they may not post content.
|
||||
|
@ -180,7 +180,7 @@ class ForumTest extends WebTestBase {
|
|||
$this->drupalGet('forum/' . $this->forum['tid']);
|
||||
$this->assertLink(t('Add new Forum topic'));
|
||||
|
||||
// Login a user with permission to edit any forum content.
|
||||
// Log in a user with permission to edit any forum content.
|
||||
$this->drupalLogin($this->editAnyTopicsUser);
|
||||
// Verify that this user can edit forum content authored by another user.
|
||||
$this->verifyForums($own_topics_user_node, TRUE);
|
||||
|
@ -281,7 +281,7 @@ class ForumTest extends WebTestBase {
|
|||
* The logged-in user.
|
||||
*/
|
||||
private function doAdminTests($user) {
|
||||
// Login the user.
|
||||
// Log in the user.
|
||||
$this->drupalLogin($user);
|
||||
|
||||
// Add forum to the Tools menu.
|
||||
|
@ -467,7 +467,7 @@ class ForumTest extends WebTestBase {
|
|||
* User has 'access administration pages' privilege.
|
||||
*/
|
||||
private function doBasicTests($user, $admin) {
|
||||
// Login the user.
|
||||
// Log in the user.
|
||||
$this->drupalLogin($user);
|
||||
// Attempt to create forum topic under a container.
|
||||
$this->createForumTopic($this->forumContainer, TRUE);
|
||||
|
@ -481,7 +481,7 @@ class ForumTest extends WebTestBase {
|
|||
* Tests a forum with a new post displays properly.
|
||||
*/
|
||||
function testForumWithNewPost() {
|
||||
// Login as the first user.
|
||||
// Log in as the first user.
|
||||
$this->drupalLogin($this->adminUser);
|
||||
// Create a forum container.
|
||||
$this->forumContainer = $this->createForum('container');
|
||||
|
@ -490,7 +490,7 @@ class ForumTest extends WebTestBase {
|
|||
// Create a topic.
|
||||
$node = $this->createForumTopic($this->forum, FALSE);
|
||||
|
||||
// Login as a second user.
|
||||
// Log in as a second user.
|
||||
$this->drupalLogin($this->postCommentUser);
|
||||
// Post a reply to the topic.
|
||||
$edit = array();
|
||||
|
@ -504,7 +504,7 @@ class ForumTest extends WebTestBase {
|
|||
$this->assertResponse(200);
|
||||
$this->assertFieldByName('comment_body[0][value]');
|
||||
|
||||
// Login as the first user.
|
||||
// Log in as the first user.
|
||||
$this->drupalLogin($this->adminUser);
|
||||
// Check that forum renders properly.
|
||||
$this->drupalGet("forum/{$this->forum['tid']}");
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\forum\Tests;
|
||||
|
||||
use Drupal\node\Entity\Node;
|
||||
use Drupal\taxonomy\Entity\Term;
|
||||
use Drupal\system\Tests\Entity\EntityUnitTestBase;
|
||||
|
||||
/**
|
||||
* Tests forum validation constraints.
|
||||
*
|
||||
* @group forum
|
||||
*/
|
||||
class ForumValidationTest extends EntityUnitTestBase {
|
||||
|
||||
/**
|
||||
* Modules to install.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = ['node', 'options', 'comment', 'taxonomy', 'forum'];
|
||||
|
||||
/**
|
||||
* Tests the forum validation constraints.
|
||||
*/
|
||||
public function testValidation() {
|
||||
// Add a forum.
|
||||
$forum = Term::create([
|
||||
'name' => 'forum 1',
|
||||
'vid' => 'forums',
|
||||
'forum_container' => 0,
|
||||
]);
|
||||
|
||||
// Add a container.
|
||||
$container = Term::create([
|
||||
'name' => 'container 1',
|
||||
'vid' => 'forums',
|
||||
'forum_container' => 1,
|
||||
]);
|
||||
|
||||
// Add a forum post.
|
||||
$forum_post = Node::create([
|
||||
'type' => 'forum',
|
||||
'title' => 'Do these pants make my butt look big?',
|
||||
]);
|
||||
|
||||
$violations = $forum_post->validate();
|
||||
$this->assertEqual(count($violations), 1);
|
||||
$this->assertEqual($violations[0]->getMessage(), 'This value should not be null.');
|
||||
|
||||
// Add the forum term.
|
||||
$forum_post->set('taxonomy_forums', $forum);
|
||||
$violations = $forum_post->validate();
|
||||
$this->assertEqual(count($violations), 0);
|
||||
|
||||
// Try to use a container.
|
||||
$forum_post->set('taxonomy_forums', $container);
|
||||
$violations = $forum_post->validate();
|
||||
$this->assertEqual(count($violations), 1);
|
||||
$this->assertEqual($violations[0]->getMessage(), t('The item %forum is a forum container, not a forum. Select one of the forums below instead.', [
|
||||
'%forum' => $container->label(),
|
||||
]));
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue