NodeSyndicateBlockTest.php in Drupal 9
File
core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php
View source
<?php
namespace Drupal\Tests\node\Functional;
class NodeSyndicateBlockTest extends NodeTestBase {
protected static $modules = [
'block',
];
protected $defaultTheme = 'stark';
protected function setUp() : void {
parent::setUp();
$admin_user = $this
->drupalCreateUser([
'administer blocks',
]);
$this
->drupalLogin($admin_user);
}
public function testSyndicateBlock() {
$this
->drupalPlaceBlock('node_syndicate_block', [
'id' => 'test_syndicate_block',
]);
$this
->drupalGet('');
$this
->assertSession()
->elementExists('xpath', '//div[@id="block-test-syndicate-block"]/*');
$this
->assertSession()
->pageTextContains('Subscribe to Drupal');
$this
->drupalGet('user');
$this
->clickLink('Subscribe to');
$this
->assertSession()
->addressEquals('rss.xml');
}
}