Mercurial > hg > isophonics-drupal-site
comparison core/modules/help/tests/src/Functional/ExperimentalHelpTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\help\Functional; | |
4 | |
5 use Drupal\Tests\BrowserTestBase; | |
6 | |
7 /** | |
8 * Verifies help for experimental modules. | |
9 * | |
10 * @group help | |
11 */ | |
12 class ExperimentalHelpTest extends BrowserTestBase { | |
13 | |
14 /** | |
15 * Modules to enable. | |
16 * | |
17 * The experimental_module_test module implements hook_help() and is in the | |
18 * Core (Experimental) package. | |
19 * | |
20 * @var array | |
21 */ | |
22 public static $modules = ['help', 'experimental_module_test', 'help_page_test']; | |
23 | |
24 /** | |
25 * The admin user. | |
26 * | |
27 * @var \Drupal\user\UserInterface | |
28 */ | |
29 protected $adminUser; | |
30 | |
31 /** | |
32 * {@inheritoc} | |
33 */ | |
34 protected function setUp() { | |
35 parent::setUp(); | |
36 $this->adminUser = $this->drupalCreateUser(['access administration pages']); | |
37 } | |
38 | |
39 /** | |
40 * Verifies that a warning message is displayed for experimental modules. | |
41 */ | |
42 public function testExperimentalHelp() { | |
43 $this->drupalLogin($this->adminUser); | |
44 $this->drupalGet('admin/help/experimental_module_test'); | |
45 $this->assertText('This module is experimental.'); | |
46 | |
47 // Regular modules should not display the message. | |
48 $this->drupalGet('admin/help/help_page_test'); | |
49 $this->assertNoText('This module is experimental.'); | |
50 | |
51 // Ensure the actual help page is displayed to avoid a false positive. | |
52 $this->assertResponse(200); | |
53 $this->assertText('online documentation for the Help Page Test module'); | |
54 } | |
55 | |
56 } |