Simple test always failing for custom module I am trying to implement simple test for my custom module. But the test case always failing for user login. In the test script what I am trying to test is whether admin page is loading properly without any errors.

I am following similar code from core modules and other contributed modules. But couldn't figureout what I am missig in mine. My test script is given below:

&lt;?php

/**
 * @file
 * Test file for custom_module module.
 */

/**
 * Default test case for the custom_module module.
 *
 * @ingroup custom_module
 */
class MyCustomModule extends DrupalWebTestCase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' =&gt; 'My Custom Module Test Case',
      'description' =&gt; 'Functional test for My Custom Module Module',
      'group' =&gt; 'My Custom Module',
    );
  }

  /**
   * {@inheritdoc}
   */
  function setUp() {
    parent::setUp('custom_module');

    $permissions = array(
      'access administration pages',
      'administer custom module',
    );
    $this-&gt;admin_user = $this-&gt;drupalCreateUser($permissions);
    $this-&gt;drupalLogin($this-&gt;admin_user);
  }

  /**
   * Test site working properly after installs the module.
   */
  function testCustomModulePageLoads() {
    $paths = array(
      '/admin/config/custom_module/manage',
    );
    foreach($paths as $path) {
      $this-&gt;drupalGet($path);
      $this-&gt;assertResponse(200, '200 response for the path ' . $path);
    }
  }

}


Result:
Try calling $this->setUp(); from the testCustomPageLoads() function.