ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilFormFieldParserTest Class Reference
+ Inheritance diagram for ilFormFieldParserTest:
+ Collaboration diagram for ilFormFieldParserTest:

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from ilCertificateBaseTestCase
 setUp ()
 
 setGlobalVariable (string $name, $value)
 
- Protected Attributes inherited from ilCertificateBaseTestCase
Container $dic
 

Detailed Description

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

Definition at line 24 of file ilFormFieldParserTest.php.

Member Function Documentation

◆ testA4()

ilFormFieldParserTest::testA4 ( )

Definition at line 26 of file ilFormFieldParserTest.php.

26  : void
27  {
28  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
29  ->getMock();
30 
31  $content = '';
32 
33  $parser = new ilFormFieldParser($xlstProcess);
34  $formFields = $parser->fetchDefaultFormFields($content);
35 
36  $this->assertSame(
37  [
38  'pageformat' => 'a4',
39  'pagewidth' => '21cm',
40  'pageheight' => '29.7cm',
41  'margin_body_top' => '0cm',
42  'margin_body_right' => '2cm',
43  'margin_body_bottom' => '0cm',
44  'margin_body_left' => '2cm',
45  'certificate_text' => ''
46  ],
47  $formFields
48  );
49  }

◆ testA4Landscape()

ilFormFieldParserTest::testA4Landscape ( )

Definition at line 138 of file ilFormFieldParserTest.php.

138  : void
139  {
140  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
141  ->getMock();
142 
143  $xlstProcess
144  ->expects($this->once())
145  ->method('process');
146 
147  $content = 'page-width="29.7cm" page-height="21cm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
148 
149  $parser = new ilFormFieldParser($xlstProcess);
150  $formFields = $parser->fetchDefaultFormFields($content);
151 
152  $this->assertSame(
153  [
154  'pageformat' => 'a4landscape',
155  'pagewidth' => '29.7cm',
156  'pageheight' => '21cm',
157  'margin_body_top' => '1cm',
158  'margin_body_right' => '2cm',
159  'margin_body_bottom' => '3cm',
160  'margin_body_left' => '4cm',
161  'certificate_text' => ''
162  ],
163  $formFields
164  );
165  }

◆ testA5()

ilFormFieldParserTest::testA5 ( )

Definition at line 80 of file ilFormFieldParserTest.php.

80  : void
81  {
82  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
83  ->getMock();
84 
85  $xlstProcess
86  ->expects($this->once())
87  ->method('process');
88 
89  $content = 'page-width="14.8cm" page-height="21cm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
90 
91  $parser = new ilFormFieldParser($xlstProcess);
92  $formFields = $parser->fetchDefaultFormFields($content);
93 
94  $this->assertSame(
95  [
96  'pageformat' => 'a5',
97  'pagewidth' => '14.8cm',
98  'pageheight' => '21cm',
99  'margin_body_top' => '1cm',
100  'margin_body_right' => '2cm',
101  'margin_body_bottom' => '3cm',
102  'margin_body_left' => '4cm',
103  'certificate_text' => ''
104  ],
105  $formFields
106  );
107  }

◆ testA5Landscape()

ilFormFieldParserTest::testA5Landscape ( )

Definition at line 109 of file ilFormFieldParserTest.php.

109  : void
110  {
111  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
112  ->getMock();
113 
114  $xlstProcess
115  ->expects($this->once())
116  ->method('process');
117 
118  $content = 'page-width="21cm" page-height="14.8cm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
119 
120  $parser = new ilFormFieldParser($xlstProcess);
121  $formFields = $parser->fetchDefaultFormFields($content);
122 
123  $this->assertSame(
124  [
125  'pageformat' => 'a5landscape',
126  'pagewidth' => '21cm',
127  'pageheight' => '14.8cm',
128  'margin_body_top' => '1cm',
129  'margin_body_right' => '2cm',
130  'margin_body_bottom' => '3cm',
131  'margin_body_left' => '4cm',
132  'certificate_text' => ''
133  ],
134  $formFields
135  );
136  }

◆ testCustomPageWidth()

ilFormFieldParserTest::testCustomPageWidth ( )

Definition at line 51 of file ilFormFieldParserTest.php.

51  : void
52  {
53  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
54  ->getMock();
55 
56  $xlstProcess
57  ->expects($this->once())
58  ->method('process');
59 
60  $content = 'page-width="210mm" page-height="310mm" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
61 
62  $parser = new ilFormFieldParser($xlstProcess);
63  $formFields = $parser->fetchDefaultFormFields($content);
64 
65  $this->assertSame(
66  [
67  'pageformat' => 'custom',
68  'pagewidth' => '210mm',
69  'pageheight' => '310mm',
70  'margin_body_top' => '1cm',
71  'margin_body_right' => '2cm',
72  'margin_body_bottom' => '3cm',
73  'margin_body_left' => '4cm',
74  'certificate_text' => ''
75  ],
76  $formFields
77  );
78  }

◆ testLetter()

ilFormFieldParserTest::testLetter ( )

Definition at line 196 of file ilFormFieldParserTest.php.

196  : void
197  {
198  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
199  ->getMock();
200 
201  $xlstProcess
202  ->expects($this->once())
203  ->method('process');
204 
205  $content = 'page-width="8.5in" page-height="11in" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
206 
207  $parser = new ilFormFieldParser($xlstProcess);
208  $formFields = $parser->fetchDefaultFormFields($content);
209 
210  $this->assertSame(
211  [
212  'pageformat' => 'letter',
213  'pagewidth' => '8.5in',
214  'pageheight' => '11in',
215  'margin_body_top' => '1cm',
216  'margin_body_right' => '2cm',
217  'margin_body_bottom' => '3cm',
218  'margin_body_left' => '4cm',
219  'certificate_text' => ''
220  ],
221  $formFields
222  );
223  }

◆ testLetterLandscape()

ilFormFieldParserTest::testLetterLandscape ( )

Definition at line 167 of file ilFormFieldParserTest.php.

167  : void
168  {
169  $xlstProcess = $this->getMockBuilder(ilCertificateXlstProcess::class)
170  ->getMock();
171 
172  $xlstProcess
173  ->expects($this->once())
174  ->method('process');
175 
176  $content = 'page-width="11in" page-height="8.5in" <fo:region-body margin="1cm 2cm 3cm 4cm"/>';
177 
178  $parser = new ilFormFieldParser($xlstProcess);
179  $formFields = $parser->fetchDefaultFormFields($content);
180 
181  $this->assertSame(
182  [
183  'pageformat' => 'letterlandscape',
184  'pagewidth' => '11in',
185  'pageheight' => '8.5in',
186  'margin_body_top' => '1cm',
187  'margin_body_right' => '2cm',
188  'margin_body_bottom' => '3cm',
189  'margin_body_left' => '4cm',
190  'certificate_text' => ''
191  ],
192  $formFields
193  );
194  }

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