◆ testDefaultTemplateCanBeSetByContext()
ilMailTemplateServiceTest::testDefaultTemplateCanBeSetByContext |
( |
| ) |
|
Definition at line 23 of file ilMailTemplateServiceTest.php.
References $service.
25 $repo = $this->getMockBuilder(ilMailTemplateRepository::class)->disableOriginalConstructor()->getMock();
28 $template->setTplId(1);
29 $template->setAsDefault(
false);
30 $template->setContext(
'phpunit');
32 $other_template = clone $template;
33 $other_template->setTplId(2);
34 $other_template->setAsDefault(
false);
36 $yet_another_template = clone $template;
37 $yet_another_template->setTplId(3);
38 $yet_another_template->setAsDefault(
true);
43 $yet_another_template,
46 $repo->expects($this->once())->method(
'findByContextId')->with($template->getContext())->willReturn($all);
47 $repo->expects($this->exactly(count($all)))->method(
'store');
48 $mustache_factory = $this->getMockBuilder(ilMustacheFactory::class)->getMock();
51 $service->setAsContextDefault($template);
53 $this->assertTrue($template->isDefault());
54 $this->assertFalse($other_template->isDefault());
55 $this->assertFalse($yet_another_template->isDefault());
◆ testDefaultTemplateForContextCanBeUnset()
ilMailTemplateServiceTest::testDefaultTemplateForContextCanBeUnset |
( |
| ) |
|
Definition at line 58 of file ilMailTemplateServiceTest.php.
References $service.
60 $repo = $this->getMockBuilder(ilMailTemplateRepository::class)->disableOriginalConstructor()->getMock();
63 $template->setTplId(1);
64 $template->setAsDefault(
true);
65 $template->setContext(
'phpunit');
67 $repo->expects($this->once())->method(
'store')->with($template);
68 $mustache_factory = $this->getMockBuilder(ilMustacheFactory::class)->getMock();
71 $service->unsetAsContextDefault($template);
73 $this->assertFalse($template->isDefault());
The documentation for this class was generated from the following file: