| 1 |
<?php |
<?php |
| 2 |
// $Id: help.test,v 1.2 2008/06/14 21:49:10 Gurpartap Exp $ |
// $Id: $ |
| 3 |
|
|
| 4 |
class HelpTestCase extends DrupalWebTestCase { |
class HelpTestCase extends DrupalWebTestCase { |
| 5 |
protected $big_user; |
protected $big_user; |
| 22 |
function setUp() { |
function setUp() { |
| 23 |
parent::setUp(); |
parent::setUp(); |
| 24 |
|
|
|
// Loading these (and other?) modules will result in failures? |
|
|
// $this->drupalModuleEnable('blog'); |
|
|
// $this->drupalModuleEnable('poll'); |
|
| 25 |
$this->getModuleList(); |
$this->getModuleList(); |
| 26 |
|
|
| 27 |
// Create users. |
// Create users. |
| 28 |
$this->big_user = $this->drupalCreateUser(array('access administration pages')); // 'administer blocks', 'administer site configuration', |
$this->big_user = $this->drupalCreateUser(array('access administration pages', 'access help', 'search help')); // 'administer blocks', 'administer site configuration', |
| 29 |
$this->any_user = $this->drupalCreateUser(array()); |
$this->any_user = $this->drupalCreateUser(array()); |
| 30 |
} |
} |
| 31 |
|
|
| 55 |
$this->drupalGet('admin/help/' . $module); |
$this->drupalGet('admin/help/' . $module); |
| 56 |
$this->assertResponse($response); |
$this->assertResponse($response); |
| 57 |
if ($response == 200) { |
if ($response == 200) { |
| 58 |
// NOTE: The asserts fail on blog and poll because the get returns the 'admin/help' node instead of the indicated node??? |
$this->assertTitle('About ' . $name . ' | Drupal', t('[' . $module . '] Title was displayed')); |
| 59 |
// if ($module == 'blog' || $module == 'poll') { |
$this->assertRaw('<h2>About ' . t($name) . '</h2>', t('[' . $module . '] Heading was displayed')); |
|
// continue; |
|
|
// } |
|
|
$this->assertTitle($name . ' | Drupal', t('[' . $module . '] Title was displayed')); |
|
|
$this->assertRaw('<h2>' . t($name) . '</h2>', t('[' . $module . '] Heading was displayed')); |
|
| 60 |
$this->assertText(t('Home ' . $crumb . ' Administer ' . $crumb . ' Help'), t('[' . $module . '] Breadcrumbs were displayed')); |
$this->assertText(t('Home ' . $crumb . ' Administer ' . $crumb . ' Help'), t('[' . $module . '] Breadcrumbs were displayed')); |
| 61 |
} |
} |
| 62 |
} |
} |