ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCertificateValueReplacementTest Class Reference
+ Inheritance diagram for ilCertificateValueReplacementTest:
+ Collaboration diagram for ilCertificateValueReplacementTest:

Public Member Functions

 testReplace ()
 
 testReplaceClientWebDir ()
 

Detailed Description

Member Function Documentation

◆ testReplace()

ilCertificateValueReplacementTest::testReplace ( )

Definition at line 26 of file ilCertificateValueReplacementTest.php.

26  : void
27  {
28  $replacement = new ilCertificateValueReplacement();
29 
30  $placeholderValues = ['NAME' => 'Peter', 'PRIZE' => 'a fantastic prize'];
31 
32  $certificateContent = '<xml>
33 [BACKGROUND_IMAGE]
34 Hurray [NAME] you have received [PRIZE]
35 </xml>';
36 
37  $replacedContent = $replacement->replace($placeholderValues, $certificateContent);
38 
39  $expected = '<xml>
40 [BACKGROUND_IMAGE]
41 Hurray Peter you have received a fantastic prize
42 </xml>';
43 
44  $this->assertSame($expected, $replacedContent);
45  }

◆ testReplaceClientWebDir()

ilCertificateValueReplacementTest::testReplaceClientWebDir ( )

Definition at line 47 of file ilCertificateValueReplacementTest.php.

47  : void
48  {
49  $replacement = new ilCertificateValueReplacement();
50 
51  $placeholderValues = ['NAME' => 'Peter', 'PRIZE' => 'a fantastic prize'];
52 
53  $certificateContent = '<xml>
54 [BACKGROUND_IMAGE]
55 [CLIENT_WEB_DIR]/background.jpg
56 Hurray [NAME] you have received [PRIZE]
57 </xml>';
58 
59  $replacedContent = $replacement->replace($placeholderValues, $certificateContent);
60 
61  $expected = '<xml>
62 [BACKGROUND_IMAGE]
63 [CLIENT_WEB_DIR]/background.jpg
64 Hurray Peter you have received a fantastic prize
65 </xml>';
66 
67  $this->assertSame($expected, $replacedContent);
68  }

The documentation for this class was generated from the following file: