AnalyzerTestBase.php in Mailhandler 8
File
tests/src/Kernel/AnalyzerTestBase.php
View source
<?php
namespace Drupal\Tests\mailhandler\Kernel;
use Drupal\KernelTests\KernelTestBase;
abstract class AnalyzerTestBase extends KernelTestBase {
public static $modules = [
'mailhandler',
'inmail',
'system',
'node',
'user',
'field',
];
protected $parser;
protected $analyzerManager;
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('user');
$this
->installConfig([
'inmail',
'mailhandler',
'user',
]);
$this
->installSchema('system', [
'sequences',
]);
$this->parser = \Drupal::service('inmail.mime_parser');
$this->analyzerManager = \Drupal::service('plugin.manager.inmail.analyzer');
}
public function getFileContent($filename) {
$path = drupal_get_path('module', 'mailhandler') . '/tests/' . $filename;
return file_get_contents(DRUPAL_ROOT . '/' . $path);
}
}