You are here

function RavenTestCase::testRaven in Raven: Sentry Integration 7

Same name and namespace in other branches
  1. 7.4 raven.test \RavenTestCase::testRaven()
  2. 7.2 raven.test \RavenTestCase::testRaven()
  3. 7.3 raven.test \RavenTestCase::testRaven()

Tests Raven module functionality.

File

./raven.test, line 47
Tests for Raven.module.

Class

RavenTestCase
Tests logging messages to the database.

Code

function testRaven() {
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('admin/config/development/raven');
  $edit['raven_enabled'] = TRUE;
  $edit['raven_watchdog_handler'] = TRUE;
  $edit['raven_watchdog_levels[6]'] = 6;
  $this
    ->drupalPost(NULL, $edit, 'Save configuration');
  $this
    ->drupalLogout();
  $library = libraries_load('sentry-php');
  $this
    ->drupalLogin($this->any_user);
  if (!$library['loaded']) {
    $this
      ->assertText('Sentry PHP library cannot be loaded. Check reports for more details.');
  }
  else {
    $this
      ->assertNoText('Sentry PHP library cannot be loaded. Check reports for more details.');
  }
}