0

What I want to do is checking whether a link is exist on frontpage.

I've set up a content with with node id 5 as my frontpage.

But when testing it, and see the verbose message (http://screencast.com/t/ldWSBwJNcO) different page appear. The default drupal frontpage appear instead of the content that I've set up.

My test code:

class MyUserManagementTestCase extends DrupalWebTestCase {

  // Some says this improve tests performance
  protected $profile = 'test';

  public static function getInfo() {
    return array(
      'name' => 'My User Management Test Case',
      'description' => 'Ensure that the My functionality for user management works.',
      'group' => 'My',
    );
  }

  public function setUp() {
    parent::setUp();
  }

  public function testFrontpage() {
    $this->drupalGet('');
    $this->assertResponse(200, t('Frontpage page is accessible'));
    $this->assertLinkByHref('user/register');
    $this->assertLinkByHref('user/login');
  }
}
0

In Simpletest each time the test is run. New Drupal install will occur. You are testing the Simpletest Database right now. There is a possibility to run simpletest on "live" db. To do so add $this->originalPrefix = $GLOBALS['db_prefix'] to your setUp()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.