7d61852ef8b65a9590563a0ecb7478e773b770cc
[yaffs-website] / web / core / modules / comment / tests / src / Functional / Views / RowRssTest.php
1 <?php
2
3 namespace Drupal\Tests\comment\Functional\Views;
4
5 /**
6  * Tests the comment rss row plugin.
7  *
8  * @group comment
9  * @see \Drupal\comment\Plugin\views\row\Rss
10  */
11 class RowRssTest extends CommentTestBase {
12
13   /**
14    * Views used by this test.
15    *
16    * @var array
17    */
18   public static $testViews = ['test_comment_rss'];
19
20   /**
21    * Test comment rss output.
22    */
23   public function testRssRow() {
24     $this->drupalGet('test-comment-rss');
25
26     // Because the response is XML we can't use the page which depends on an
27     // HTML tag being present.
28     $result = $this->getSession()->getDriver()->find('//item');
29     $this->assertEqual(count($result), 1, 'Just one comment was found in the rss output.');
30
31     $this->assertEqual($result[0]->find('xpath', '//pubDate')->getHtml(), gmdate('r', $this->comment->getCreatedTime()), 'The right pubDate appears in the rss output.');
32   }
33
34 }