You are here

function MerciTestCase::setUp in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2

Same name and namespace in other branches
  1. 7.2 tests/merci_testcase.php \MerciTestCase::setUp()

Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix. A temporary files directory is created with the same name as the database prefix.

Parameters

...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.

Overrides DrupalWebTestCase::setUp

5 calls to MerciTestCase::setUp()
MerciAdminTestCase::setUp in tests/merci_admin.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciBucketTestCase::setUp in tests/merci_bucket.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciIssueTestCase::setUp in tests/merci_issues.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciResourceTestCase::setUp in tests/merci_resource.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciUserTestCase::setUp in tests/merci_user.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
5 methods override MerciTestCase::setUp()
MerciAdminTestCase::setUp in tests/merci_admin.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciBucketTestCase::setUp in tests/merci_bucket.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciIssueTestCase::setUp in tests/merci_issues.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciResourceTestCase::setUp in tests/merci_resource.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MerciUserTestCase::setUp in tests/merci_user.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

File

tests/merci_testcase.php, line 19
Simpletest case for node_example module.

Class

MerciTestCase
Functionality tests for merci module. General setup and functions all merci tests should inherit.

Code

function setUp() {

  // Enable the module.
  parent::setUp('content', 'fieldgroup', 'optionwidgets', 'text', 'number', 'jquery_ui', 'date_api', 'date', 'date_timezone', 'date_popup', 'text', 'views', 'merci');

  // Create admin user.
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'administer nodes',
    // Required to set revision checkbox
    'administer content types',
    'access administration pages',
    'administer site configuration',
    'view revisions',
    'revert revisions',
    //'access devel information',
    'administer MERCI',
    'manage reservations',
  ));

  // Login the admin user.
  $this
    ->drupalLogin($this->admin_user);
  $settings = array(
    'merci_default_reservation_status' => '2',
    'merci_max_days_advance_reservation' => '0',
    'merci_saturday_is_weekend' => '1',
    'merci_sunday_is_weekend' => '1',
    'merci_hours_mon' => '09:00-18:00',
    'merci_hours_tue' => '09:00-18:00',
    'merci_hours_wed' => '09:00-18:00',
    'merci_hours_thu' => '09:00-18:00',
    'merci_hours_fri' => '09:00-18:00',
    'merci_hours_sat' => '09:00-18:00',
    'merci_hours_sun' => '09:00-18:00',
    'merci_hours_admin' => '07:00-22:00',
    'merci_closed_dates' => '12-25',
    'merci_lock' => FALSE,
  );
  $this
    ->merciCreateConfig($settings);
  $settings = array(
    'date_default_timezone_name' => 'America/Los_Angeles',
  );
  $this
    ->drupalPost('admin/settings/date-time', $settings, t('Save configuration'));
  $this
    ->assertText(t("The configuration options have been saved."));
  $settings = array(
    'input_format' => 'Y-m-d H:i',
  );
  $this
    ->drupalPost('admin/content/node-type/merci-reservation/fields/field_merci_date', $settings, t('Save field settings'));
  $this
    ->assertText(t("Saved field Reservation."));
}