Version 1
[yaffs-website] / web / core / modules / node / tests / src / Functional / NodeSyndicateBlockTest.php
1 <?php
2
3 namespace Drupal\Tests\node\Functional;
4
5 /**
6  * Tests if the syndicate block is available.
7  *
8  * @group node
9  */
10 class NodeSyndicateBlockTest extends NodeTestBase {
11
12   /**
13    * Modules to enable.
14    *
15    * @var array
16    */
17   public static $modules = ['block'];
18
19   protected function setUp() {
20     parent::setUp();
21
22     // Create a user and log in.
23     $admin_user = $this->drupalCreateUser(['administer blocks']);
24     $this->drupalLogin($admin_user);
25   }
26
27   /**
28    * Tests that the "Syndicate" block is shown when enabled.
29    */
30   public function testSyndicateBlock() {
31     // Place the "Syndicate" block and confirm that it is rendered.
32     $this->drupalPlaceBlock('node_syndicate_block', ['id' => 'test_syndicate_block']);
33     $this->drupalGet('');
34     $this->assertFieldByXPath('//div[@id="block-test-syndicate-block"]/*', NULL, 'Syndicate block found.');
35   }
36
37 }