You are here

public function CacheUnitTestCase::test2974216 in MongoDB 7

Test issue #2974216.

File

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

Class

CacheUnitTestCase

Namespace

Drupal\mongodb_cache\Tests

Code

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.");
}