You are here

public function RocketChatTestUnitTest::setUp in Rocket.Chat 7

Same name and namespace in other branches
  1. 7.2 rocket_chat.test \RocketChatTestUnitTest::setUp()

Set up the test environment.

Note that we use drupal_load() instead of passing our module dependency to parent::setUp(). That's because we're using DrupalUnitTestCase, and thus we don't want to install the module, only load it's code.

Also, DrupalUnitTestCase can't actually install modules. This is by design.

Overrides DrupalUnitTestCase::setUp

File

./rocket_chat.test, line 47

Class

RocketChatTestUnitTest
Although most core test cases are based on DrupalWebTestCase and are functional tests (exercising the web UI) we also have DrupalUnitTestCase, which executes much faster because a Drupal install does not have to be one. No environment is provided to a…

Code

public function setUp() {
  drupal_load('module', 'rocket_chat');
  module_load_include('class.inc', 'rocket_chat', 'RocketChat');
  parent::setUp();
}