Class ilMailTemplateRepository.
More...
◆ testEntityCanBeDeleted()
ilMailTemplateRepositoryTest::testEntityCanBeDeleted |
( |
ilMailTemplate |
$template | ) |
|
◆ testEntityCanBeModified()
ilMailTemplateRepositoryTest::testEntityCanBeModified |
( |
ilMailTemplate |
$template | ) |
|
testEntityCanBeSaved
- Exceptions
-
Definition at line 60 of file ilMailTemplateRepositoryTest.php.
62 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
66 $db->expects($this->once())->method(
'update');
68 $repository->store($template);
◆ testEntityCanBeSaved()
ilMailTemplateRepositoryTest::testEntityCanBeSaved |
( |
| ) |
|
- Exceptions
-
Definition at line 30 of file ilMailTemplateRepositoryTest.php.
32 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
39 $template->setTitle(
'phpunit');
40 $template->setSubject(
'FooBar');
41 $template->setMessage(
'FooBar');
42 $template->setLang(
'de');
43 $template->setContext(
'4711');
44 $template->setAsDefault(
true);
46 $db->expects($this->once())->method(
'nextId')->willReturn($templateId);
47 $db->expects($this->once())->method(
'insert');
49 $repository->store($template);
51 $this->assertSame($templateId, $template->getTplId());
◆ testExceptionIsRaisedIfNoTemplateCanBeFoundById()
ilMailTemplateRepositoryTest::testExceptionIsRaisedIfNoTemplateCanBeFoundById |
( |
| ) |
|
- Exceptions
-
Definition at line 114 of file ilMailTemplateRepositoryTest.php.
116 $this->expectException(OutOfBoundsException::class);
118 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
119 $statement = $this->getMockBuilder(ilDBStatement::class)->getMock();
121 $db->expects($this->once())->method(
'queryF')->willReturn($statement);
122 $db->expects($this->once())->method(
'numRows')->willReturn(0);
123 $db->expects($this->never())->method(
'fetchAssoc');
126 $repository->findById(4711);
◆ testTemplateCanBeFoundById()
ilMailTemplateRepositoryTest::testTemplateCanBeFoundById |
( |
| ) |
|
- Exceptions
-
Definition at line 91 of file ilMailTemplateRepositoryTest.php.
93 $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
94 $statement = $this->getMockBuilder(ilDBStatement::class)->getMock();
99 $emptyTemplate->setTplId($templateId);
101 $db->expects($this->once())->method(
'queryF')->willReturn($statement);
102 $db->expects($this->once())->method(
'numRows')->willReturn(1);
103 $db->expects($this->once())->method(
'fetchAssoc')->willReturn($emptyTemplate->toArray());
106 $template = $repository->findById(4711);
108 $this->assertSame($templateId, $template->getTplId());
The documentation for this class was generated from the following file: