PdfUsingMpdfTestBase.php in PDF using mPDF 8.2
File
tests/src/Functional/PdfUsingMpdfTestBase.php
View source
<?php
namespace Drupal\Tests\pdf_using_mpdf\Functional;
use Drupal\node\NodeTypeInterface;
use Drupal\Tests\BrowserTestBase;
class PdfUsingMpdfTestBase extends BrowserTestBase {
protected $defaultTheme = 'stark';
public static $modules = [
'node',
'user',
'pdf_using_mpdf',
];
protected $adminUser;
protected $accessUser;
protected $nodeTypes;
protected $types = [
[
'id' => 'type_a',
'label' => 'Type A',
],
[
'id' => 'type_b',
'label' => 'Type B',
],
[
'id' => 'type_c',
'label' => 'Type C',
],
];
protected function setUp() {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser([
'administer permissions',
'access content',
'administer content types',
'administer mpdf settings',
]);
$this->accessUser = $this
->drupalCreateUser([
'access content',
]);
foreach ($this->types as $type) {
$this
->drupalCreateContentType([
'type' => $type['id'],
'name' => $type['label'],
]);
}
$this->nodeTypes = $this->container
->get('entity_type.manager')
->getStorage('node_type')
->loadMultiple();
}
public function tearDown() {
parent::tearDown();
\Drupal::unsetContainer();
}
}