ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 9 of file ilCertificateValueReplacementTest.php.

10  {
11  $replacement = new ilCertificateValueReplacement('/some/where');
12 
13  $placeholderValues = array('NAME' => 'Peter', 'PRIZE' => 'a fantastic prize');
14 
15  $certificateContent = '<xml>
16 [BACKGROUND_IMAGE]
17 Hurray [NAME] you have received [PRIZE]
18 </xml>';
19 
20  $replacedContent = $replacement->replace($placeholderValues, $certificateContent);
21 
22  $expected = '<xml>
23 [BACKGROUND_IMAGE]
24 Hurray Peter you have received a fantastic prize
25 </xml>';
26 
27  $this->assertEquals($expected, $replacedContent);
28  }

◆ testReplaceClientWebDir()

ilCertificateValueReplacementTest::testReplaceClientWebDir ( )

Definition at line 30 of file ilCertificateValueReplacementTest.php.

31  {
32  $replacement = new ilCertificateValueReplacement('/some/where');
33 
34  $placeholderValues = array('NAME' => 'Peter', 'PRIZE' => 'a fantastic prize');
35 
36  $certificateContent = '<xml>
37 [BACKGROUND_IMAGE]
38 [CLIENT_WEB_DIR]/background.jpg
39 Hurray [NAME] you have received [PRIZE]
40 </xml>';
41 
42  $replacedContent = $replacement->replace($placeholderValues, $certificateContent);
43 
44  $expected = '<xml>
45 [BACKGROUND_IMAGE]
46 [CLIENT_WEB_DIR]/background.jpg
47 Hurray Peter you have received a fantastic prize
48 </xml>';
49 
50  $this->assertEquals($expected, $replacedContent);
51  }

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