class CacheUnitTestCase in MongoDB 7
Hierarchy
- class \Drupal\mongodb_cache\Tests\CacheUnitTestCase extends \Drupal\mongodb_cache\Tests\DrupalUnitTestCase uses CacheTestTrait
Expanded class hierarchy of CacheUnitTestCase
File
- mongodb_cache/
src/ Tests/ CacheUnitTestCase.php, line 85
Namespace
Drupal\mongodb_cache\TestsView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheTestTrait:: |
public static | function | Declare the test to Simpletest. | |
CacheUnitTestCase:: |
public | function | Test issue #2974216. |