Loading core/modules/node/src/Plugin/Block/SyndicateBlock.php +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockBase; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; /** * Provides a 'Syndicate' block that links to the site's RSS feed. Loading Loading @@ -39,7 +40,7 @@ protected function blockAccess(AccountInterface $account) { public function build() { return [ '#theme' => 'feed_icon', '#url' => 'rss.xml', '#url' => Url::fromUri('internal:/rss.xml'), ]; } Loading core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ public function testSyndicateBlock() { $this->drupalPlaceBlock('node_syndicate_block', ['id' => 'test_syndicate_block']); $this->drupalGet(''); $this->assertSession()->elementExists('xpath', '//div[@id="block-test-syndicate-block"]/*'); // Tests the syndicate block RSS link rendered at non-front pages. $this->drupalGet('user'); $this->clickLink('Subscribe to'); $this->assertSession()->addressEquals('rss.xml'); } } Loading
core/modules/node/src/Plugin/Block/SyndicateBlock.php +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockBase; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; /** * Provides a 'Syndicate' block that links to the site's RSS feed. Loading Loading @@ -39,7 +40,7 @@ protected function blockAccess(AccountInterface $account) { public function build() { return [ '#theme' => 'feed_icon', '#url' => 'rss.xml', '#url' => Url::fromUri('internal:/rss.xml'), ]; } Loading
core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ public function testSyndicateBlock() { $this->drupalPlaceBlock('node_syndicate_block', ['id' => 'test_syndicate_block']); $this->drupalGet(''); $this->assertSession()->elementExists('xpath', '//div[@id="block-test-syndicate-block"]/*'); // Tests the syndicate block RSS link rendered at non-front pages. $this->drupalGet('user'); $this->clickLink('Subscribe to'); $this->assertSession()->addressEquals('rss.xml'); } }