You are here

class CacheUnitTestCase in MongoDB 7

Hierarchy

Expanded class hierarchy of CacheUnitTestCase

File

mongodb_cache/src/Tests/CacheUnitTestCase.php, line 85

Namespace

Drupal\mongodb_cache\Tests
View source
class CacheUnitTestCase extends \DrupalUnitTestCase {

  // @codingStandardsIgnoreEnd
  use CacheTestTrait;

  /**
   * Test issue #2974216.
   */
  public function test2974216() {
    $message = "Issue #2974216";
    $bin = new MockBin($message);
    $bin
      ->set("foo", "bar");
    $expected = t('MongoDB cache problem %exception.', [
      '%exception' => $message,
    ]);
    $level = 'error';
    $messages = drupal_get_messages($level)[$level];
    $found = FALSE;
    foreach ($messages as $message) {
      if (strpos($message, $expected) !== FALSE) {
        $found = TRUE;
        break;
      }
    }
    $this
      ->assertTrue($found, "Notification works on save() error.");
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheTestTrait::getInfo public static function Declare the test to Simpletest.
CacheUnitTestCase::test2974216 public function Test issue #2974216.