ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilFormFieldParserTest Class Reference
+ Inheritance diagram for ilFormFieldParserTest:
+ Collaboration diagram for ilFormFieldParserTest:

Public Member Functions

 testA4 ()
 
 testCustomPageWidth ()
 
 testA5 ()
 
 testA5Landscape ()
 
 testA4Landscape ()
 
 testLetterLandscape ()
 
 testLetter ()
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 7 of file ilFormFieldParserTest.php.

Member Function Documentation

◆ testA4()

ilFormFieldParserTest::testA4 ( )

Definition at line 9 of file ilFormFieldParserTest.php.

10 {
11 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
12 ->getMock();
13
14 $content = '';
15
16 $parser = new ilFormFieldParser($xlstProcess);
17 $formFields = $parser->fetchDefaultFormFields($content);
18
19 $this->assertEquals(
20 array(
21 'pageformat' => 'a4',
22 'pagewidth' => '21cm',
23 'pageheight' => '29.7cm',
24 'margin_body_top' => '0cm',
25 'margin_body_right' => '2cm',
26 'margin_body_bottom' => '0cm',
27 'margin_body_left' => '2cm',
28 'certificate_text' => ''
29 ),
30 $formFields
31 );
32 }
$parser
Definition: BPMN2Parser.php:23

References $parser.

◆ testA4Landscape()

ilFormFieldParserTest::testA4Landscape ( )

Definition at line 121 of file ilFormFieldParserTest.php.

122 {
123 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
124 ->getMock();
125
126 $xlstProcess
127 ->expects($this->once())
128 ->method('process');
129
130 $content = 'page-width="29.7cm" page-height="21cm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
131
132 $parser = new ilFormFieldParser($xlstProcess);
133 $formFields = $parser->fetchDefaultFormFields($content);
134
135 $this->assertEquals(
136 array(
137 'pageformat' => 'a4landscape',
138 'pagewidth' => '29.7cm',
139 'pageheight' => '21cm',
140 'margin_body_top' => '1cm',
141 'margin_body_right' => '2cm',
142 'margin_body_bottom' => '3cm',
143 'margin_body_left' => '4cm',
144 'certificate_text' => ''
145 ),
146 $formFields
147 );
148 }

References $parser.

◆ testA5()

ilFormFieldParserTest::testA5 ( )

Definition at line 63 of file ilFormFieldParserTest.php.

64 {
65 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
66 ->getMock();
67
68 $xlstProcess
69 ->expects($this->once())
70 ->method('process');
71
72 $content = 'page-width="14.8cm" page-height="21cm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
73
74 $parser = new ilFormFieldParser($xlstProcess);
75 $formFields = $parser->fetchDefaultFormFields($content);
76
77 $this->assertEquals(
78 array(
79 'pageformat' => 'a5',
80 'pagewidth' => '14.8cm',
81 'pageheight' => '21cm',
82 'margin_body_top' => '1cm',
83 'margin_body_right' => '2cm',
84 'margin_body_bottom' => '3cm',
85 'margin_body_left' => '4cm',
86 'certificate_text' => ''
87 ),
88 $formFields
89 );
90 }

References $parser.

◆ testA5Landscape()

ilFormFieldParserTest::testA5Landscape ( )

Definition at line 92 of file ilFormFieldParserTest.php.

93 {
94 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
95 ->getMock();
96
97 $xlstProcess
98 ->expects($this->once())
99 ->method('process');
100
101 $content = 'page-width="21cm" page-height="14.8cm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
102
103 $parser = new ilFormFieldParser($xlstProcess);
104 $formFields = $parser->fetchDefaultFormFields($content);
105
106 $this->assertEquals(
107 array(
108 'pageformat' => 'a5landscape',
109 'pagewidth' => '21cm',
110 'pageheight' => '14.8cm',
111 'margin_body_top' => '1cm',
112 'margin_body_right' => '2cm',
113 'margin_body_bottom' => '3cm',
114 'margin_body_left' => '4cm',
115 'certificate_text' => ''
116 ),
117 $formFields
118 );
119 }

References $parser.

◆ testCustomPageWidth()

ilFormFieldParserTest::testCustomPageWidth ( )

Definition at line 34 of file ilFormFieldParserTest.php.

35 {
36 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
37 ->getMock();
38
39 $xlstProcess
40 ->expects($this->once())
41 ->method('process');
42
43 $content = 'page-width="210mm" page-height="310mm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
44
45 $parser = new ilFormFieldParser($xlstProcess);
46 $formFields = $parser->fetchDefaultFormFields($content);
47
48 $this->assertEquals(
49 array(
50 'pageformat' => 'custom',
51 'pagewidth' => '210mm',
52 'pageheight' => '310mm',
53 'margin_body_top' => '1cm',
54 'margin_body_right' => '2cm',
55 'margin_body_bottom' => '3cm',
56 'margin_body_left' => '4cm',
57 'certificate_text' => ''
58 ),
59 $formFields
60 );
61 }

References $parser.

◆ testLetter()

ilFormFieldParserTest::testLetter ( )

Definition at line 179 of file ilFormFieldParserTest.php.

180 {
181 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
182 ->getMock();
183
184 $xlstProcess
185 ->expects($this->once())
186 ->method('process');
187
188 $content = 'page-width="8.5in" page-height="11in" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
189
190 $parser = new ilFormFieldParser($xlstProcess);
191 $formFields = $parser->fetchDefaultFormFields($content);
192
193 $this->assertEquals(
194 array(
195 'pageformat' => 'letter',
196 'pagewidth' => '8.5in',
197 'pageheight' => '11in',
198 'margin_body_top' => '1cm',
199 'margin_body_right' => '2cm',
200 'margin_body_bottom' => '3cm',
201 'margin_body_left' => '4cm',
202 'certificate_text' => ''
203 ),
204 $formFields
205 );
206 }

References $parser.

◆ testLetterLandscape()

ilFormFieldParserTest::testLetterLandscape ( )

Definition at line 150 of file ilFormFieldParserTest.php.

151 {
152 $xlstProcess = $this->getMockBuilder('ilCertificateXlstProcess')
153 ->getMock();
154
155 $xlstProcess
156 ->expects($this->once())
157 ->method('process');
158
159 $content = 'page-width="11in" page-height="8.5in" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
160
161 $parser = new ilFormFieldParser($xlstProcess);
162 $formFields = $parser->fetchDefaultFormFields($content);
163
164 $this->assertEquals(
165 array(
166 'pageformat' => 'letterlandscape',
167 'pagewidth' => '11in',
168 'pageheight' => '8.5in',
169 'margin_body_top' => '1cm',
170 'margin_body_right' => '2cm',
171 'margin_body_bottom' => '3cm',
172 'margin_body_left' => '4cm',
173 'certificate_text' => ''
174 ),
175 $formFields
176 );
177 }

References $parser.


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