protected function CourierSystemTest::createGlobalTemplateCollection in Courier 8
Same name and namespace in other branches
- 2.x courier_system/tests/src/Kernel/CourierSystemTest.php \Drupal\Tests\courier_system\Kernel\CourierSystemTest::createGlobalTemplateCollection()
Create a global template collection and change its email body.
Parameters
$id: The ID for the new global template collection.
$email_body: Change the email template body.
Return value
\Drupal\courier\Entity\GlobalTemplateCollectionInterface
2 calls to CourierSystemTest::createGlobalTemplateCollection()
- CourierSystemTest::testNonOverride in courier_system/
tests/ src/ Kernel/ CourierSystemTest.php - Test courier system override is off.
- CourierSystemTest::testOverride in courier_system/
tests/ src/ Kernel/ CourierSystemTest.php - Test courier system override is on.
File
- courier_system/
tests/ src/ Kernel/ CourierSystemTest.php, line 149
Class
- CourierSystemTest
- Tests Courier system.
Namespace
Drupal\Tests\courier_system\KernelCode
protected function createGlobalTemplateCollection($id, $email_body) {
$gtc = GlobalTemplateCollection::create([
'id' => $id,
]);
$gtc
->save();
$gtc
->getTemplateCollection()
->getTemplate('courier_email')
->setSubject($this
->randomMachineName())
->setBody($email_body)
->save();
return $gtc;
}