Issue #1591440 by aspilicious: Convert help tests to PSR-0.
parent
18f12d9043
commit
6083ab6a71
|
@ -3,4 +3,3 @@ description = Manages the display of online help.
|
|||
package = Core
|
||||
version = VERSION
|
||||
core = 8.x
|
||||
files[] = help.test
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Tests for help.module.
|
||||
* Definition of Drupal\help\Tests\HelpTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\help\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
/**
|
||||
* Tests help display and user access for all modules implementing help.
|
||||
*/
|
||||
class HelpTestCase extends WebTestBase {
|
||||
class HelpTest extends WebTestBase {
|
||||
// Tests help implementations of many arbitrary core modules.
|
||||
protected $profile = 'standard';
|
||||
|
||||
|
@ -106,37 +108,3 @@ class HelpTestCase extends WebTestBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a module without help to verify it is not listed in the help page.
|
||||
*/
|
||||
class NoHelpTestCase extends WebTestBase {
|
||||
/**
|
||||
* The user who will be created.
|
||||
*/
|
||||
protected $big_user;
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'No help',
|
||||
'description' => 'Verify no help is displayed for modules not providing any help.',
|
||||
'group' => 'Help',
|
||||
);
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
// Use one of the test modules that do not implement hook_help().
|
||||
parent::setUp('menu_test');
|
||||
$this->big_user = $this->drupalCreateUser(array('access administration pages'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures modules not implementing help do not appear on admin/help.
|
||||
*/
|
||||
function testMainPageNoHelp() {
|
||||
$this->drupalLogin($this->big_user);
|
||||
|
||||
$this->drupalGet('admin/help');
|
||||
$this->assertNoText('Hook menu tests', t('Making sure the test module menu_test does not display a help link in admin/help'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\help\Tests\NoHelpTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\help\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
/**
|
||||
* Tests a module without help to verify it is not listed in the help page.
|
||||
*/
|
||||
class NoHelpTest extends WebTestBase {
|
||||
/**
|
||||
* The user who will be created.
|
||||
*/
|
||||
protected $big_user;
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => 'No help',
|
||||
'description' => 'Verify no help is displayed for modules not providing any help.',
|
||||
'group' => 'Help',
|
||||
);
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
// Use one of the test modules that do not implement hook_help().
|
||||
parent::setUp('menu_test');
|
||||
$this->big_user = $this->drupalCreateUser(array('access administration pages'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures modules not implementing help do not appear on admin/help.
|
||||
*/
|
||||
function testMainPageNoHelp() {
|
||||
$this->drupalLogin($this->big_user);
|
||||
|
||||
$this->drupalGet('admin/help');
|
||||
$this->assertNoText('Hook menu tests', t('Making sure the test module menu_test does not display a help link in admin/help'));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue