You are here

public function CourierGlobalCollectionEntityTest::testTemplateContents in Courier 2.x

Same name and namespace in other branches
  1. 8 tests/src/Kernel/CourierGlobalCollectionEntityTest.php \Drupal\Tests\courier\Kernel\CourierGlobalCollectionEntityTest::testTemplateContents()

Test template contents.

File

tests/src/Kernel/CourierGlobalCollectionEntityTest.php, line 27

Class

CourierGlobalCollectionEntityTest
Tests Courier global template collections entities.

Namespace

Drupal\Tests\courier\Kernel

Code

public function testTemplateContents() {
  $gtc = GlobalTemplateCollection::create([
    'id' => $this
      ->randomMachineName(),
  ]);
  $contents = [
    'message' => $this
      ->randomString(),
  ];
  $gtc
    ->setTemplate('courier_test_message', $contents);
  $this
    ->assertEquals($contents, $gtc
    ->getTemplate('courier_test_message'));
}