Passed
Push — master ( 3f48a5...29e5e7 )
by
unknown
08:39
created

PhpDocxTemplateTest::testSections()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 85
Code Lines 39

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 39
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 85
rs 9.296

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Doctrine\Tests\DBAL\Query;
4
5
use PHPUnit\Framework\TestCase;
6
use DOMDocument;
7
use PhpDocxTemplate\PhpDocxTemplate;
8
use PhpDocxTemplate\DocxDocument;
9
use ZipArchive;
10
use Twig\Loader\ArrayLoader;
11
use Twig\Environment;
12
13
class PhpDocxTemplateTest extends TestCase
14
{
15
    private const TEMPLATE1 = __DIR__ . "/templates/template1.docx";
16
    private const TEMPLATE2 = __DIR__ . "/templates/template2.docx";
17
    private const TEMPLATE3 = __DIR__ . "/templates/template3.docx";
18
    private const TEMPLATE4 = __DIR__ . "/templates/template4.docx";
19
    private const TEMPLATE5 = __DIR__ . "/templates/template5.docx";
20
    private const TEMPLATE8 = __DIR__ . "/templates/template8.docx";
21
    private const TEMPLATE9 = __DIR__ . "/templates/template9.docx";
22
23
    public function testXmlToString(): void
24
    {
25
        $xml = new DOMDocument('1.0');
26
        $root = $xml->createElement('book');
27
        $root = $xml->appendChild($root);
28
        $title = $xml->createElement('title');
29
        $title = $root->appendChild($title);
30
        $text = $xml->createTextNode('Title');
31
        $title->appendChild($text);
32
        $reporter = new PhpDocxTemplate(self::TEMPLATE1);
33
34
        $this->assertEquals(
35
            $reporter->xmlToString($xml),
36
            "<?xml version=\"1.0\"?>\n<book><title>Title</title></book>\n"
37
        );
38
        $reporter->close();
39
    }
40
41
    public function testGetDocx(): void
42
    {
43
        $reporter = new PhpDocxTemplate(self::TEMPLATE1);
44
        $this->assertInstanceOf(DocxDocument::class, $reporter->getDocx());
45
        $reporter->close();
46
    }
47
48
    public function testGetXml(): void
49
    {
50
        $reporter = new PhpDocxTemplate(self::TEMPLATE1);
51
        $this->assertEquals(
52
            $reporter->getXml(),
53
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
54
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" " .
55
            "xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" " .
56
            "xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" " .
57
            "xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\" " .
58
            "xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" " .
59
            "xmlns:cx4=\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" " .
60
            "xmlns:cx5=\"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\" " .
61
            "xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\" " .
62
            "xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" " .
63
            "xmlns:cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" " .
64
            "xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" " .
65
            "xmlns:aink=\"http://schemas.microsoft.com/office/drawing/2016/ink\" " .
66
            "xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" " .
67
            "xmlns:o=\"urn:schemas-microsoft-com:office:office\" " .
68
            "xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" " .
69
            "xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" " .
70
            "xmlns:v=\"urn:schemas-microsoft-com:vml\" " .
71
            "xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" " .
72
            "xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" " .
73
            "xmlns:w10=\"urn:schemas-microsoft-com:office:word\" " .
74
            "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" " .
75
            "xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" " .
76
            "xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" " .
77
            "xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\" " .
78
            "xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" " .
79
            "xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" " .
80
            "xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" " .
81
            "xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" " .
82
            "xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" " .
83
            "mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:p w14:paraId=\"504F2588\" " .
84
            "w14:textId=\"54DF26C8\" w:rsidR=\"0090657C\" w:rsidRPr=\"00FA3F61\" " .
85
            "w:rsidRDefault=\"00FA3F61\" w:rsidP=\"00C13DD6\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/>" .
86
            "</w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>Hello {{ object }}!</w:t>" .
87
            "</w:r><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/><w:bookmarkEnd w:id=\"0\"/></w:p>" .
88
            "<w:sectPr w:rsidR=\"0090657C\" w:rsidRPr=\"00FA3F61\"><w:pgSz w:w=\"11906\" w:h=\"16838\"/>" .
89
            "<w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" w:left=\"1701\" w:header=\"708\" " .
90
            "w:footer=\"708\" w:gutter=\"0\"/><w:cols w:space=\"708\"/><w:docGrid w:linePitch=\"360\"/>" .
91
            "</w:sectPr></w:body></w:document>\n"
92
        );
93
        $reporter->close();
94
    }
95
96
    public function testPatchXml(): void
97
    {
98
        $reporter = new PhpDocxTemplate(self::TEMPLATE1);
99
        //test stripTags
100
        $xml = "{<tag>%Hello</w:t><w:t>\nworld%<tag>}\n{<tag>{Hi</w:t><w:t>\nthere}<tag>}\n";
101
        $this->assertEquals(
102
            $reporter->patchXml($xml),
103
            "{%Hello\nworld%}\n{{Hi\nthere}}\n"
104
        );
105
106
        //test colspan
107
        $xml = "<w:tc xeLLm[t6;cT&!Z_#KI8cniins[)UX>TAnAaqg_a}sePvK.OO#Q=B-]cBDFM8UL]8m@i" .
108
               "Ct{% colspan val%}TkuSd<w:r meg+PYSJWO}~k<w:t></w:t></w:r>" .
109
               "<w:gridSpan88MJ@1bX/><w:tcPrL4><w:gridSpan@1bY/>?Nl`z:^kY@FXeJ@P{8WhCt0__/,8woI2." .
110
               "8#[r_Cqig!5Qt{8gl5ls<9Ci|^QN2IK#L[cB9@:XclVQQIxe</w:tc>";
111
        $this->assertEquals(
112
            $reporter->patchXml($xml),
113
            '<w:tc xeLLm[t6;cT&!Z_#KI8cniins[)UX>TAnAaqg_a}sePvK.OO#Q=B-]cBDFM8UL]8m@iCtTkuSd<w:tcPrL4>' .
114
            '<w:gridSpan w:val="{{val}}"/><w:gridSpan@1bY/>?Nl`z:^kY@FXeJ@P{8WhCt0__/,8woI2.8#[r_Cqig!5Qt' .
115
            '{8gl5ls<9Ci|^QN2IK#L[cB9@:XclVQQIxe</w:tc>'
116
        );
117
118
        //test cellbg
119
        $xml = "<w:tc xeLLm[t6;cT&!Z_#KI8cniins[)UX>TAnAaqg_a}sePvK.OO#Q=B-]cBDFM8UL]8m@i" .
120
               "Ct{% cellbg val%}TkuSd<w:r meg+PYSJWO}~k<w:t></w:t></w:r>" .
121
               "<w:shd88MJ@1bX/><w:tcPrL4><w:shd@1bY/>?Nl`z:^kY@FXeJ@P{8WhCt0__/,8woI2." .
122
               "8#[r_Cqig!5Qt{8gl5ls<9Ci|^QN2IK#L[cB9@:XclVQQIxe</w:tc>";
123
        $this->assertEquals(
124
            $reporter->patchXml($xml),
125
            '<w:tc xeLLm[t6;cT&!Z_#KI8cniins[)UX>TAnAaqg_a}sePvK.OO#Q=B-]cBDFM8UL]8m@iCtTkuSd<w:tcPrL4>' .
126
            '<w:shd w:val="clear" w:color="auto" w:fill="{{val}}"/><w:shd@1bY/>?Nl`z:^kY@FXeJ@P{8WhCt0__/,' .
127
            '8woI2.8#[r_Cqig!5Qt{8gl5ls<9Ci|^QN2IK#L[cB9@:XclVQQIxe</w:tc>'
128
        );
129
130
        $xml = "{%r _Rom{X=aC3/s#W#~o<#d:tH^>DTAz;s<}O0RJ#V!wW:]%kR@wzLf*\iu^zAGrr!3]v<SUc|B)o>kA.:*1?,0%}";
131
        $this->assertEquals(
132
            $reporter->patchXml($xml),
133
            '</w:t></w:r><w:r><w:t xml:space="preserve">{%r _Rom{X=aC3/s#W#~o<#d:tH^>DTAz;s<}O0RJ#V!wW:]%kR' .
134
            '@wzLf*\iu^zAGrr!3]v<SUc|B)o>kA.:*1?,0%}</w:t></w:r><w:r><w:t xml:space="preserve">'
135
        );
136
137
        // test vMerge
138
        $xml = "<w:tc></w:tcPr>t/H-Q.X)jC_sI6(J7w-;QI&JpDG}:>f02Zls<8(7&SEyc>" .
139
               "`@P/<Ero^KEbL`EX^<w:t>{% vm %}</w:t></w:tc>";
140
        $this->assertEquals(
141
            $reporter->patchXml($xml),
142
            '<w:tc><w:vMerge w:val="{% if loop.first %}restart{% else %}continue' .
143
            '{% endif %}"/></w:tcPr>t/H-Q.X)jC_sI6(J7w-;QI&JpDG}:>f02Zls<8(7&SEyc>`' .
144
            '@P/<Ero^KEbL`EX^<w:t>{% if loop.first %}{% endif %}</w:t></w:tc>'
145
        );
146
147
        // test hMerge
148
        $xml = "<w:tc></w:tcPr>t/H-Q.X)jC_sI6(J7w-;QI&JpDG}:>f02Zls<8(7&SEyc>" .
149
               "`@P/<Ero^KEbL`EX^<w:t>{% hm %}</w:t></w:tc>";
150
        $this->assertEquals(
151
            $reporter->patchXml($xml),
152
            '{% if loop.first %}<w:tc><w:gridSpan w:val="{{ loop.length }}"/></w:tcPr>t/H-Q.X)' .
153
            'jC_sI6(J7w-;QI&JpDG}:>f02Zls<8(7&SEyc>`@P/<Ero^KEbL`EX^<w:t></w:t></w:tc>{% endif %}'
154
        );
155
156
        // test cleanTags
157
        $xml = '{%&#8216;&lt;&gt;“”‘’%}';
158
        $this->assertEquals(
159
            $reporter->patchXml($xml),
160
            "{%'<>\"\"''%}"
161
        );
162
        $reporter->close();
163
    }
164
165
    public function testRenderXml(): void
166
    {
167
        $reporter = new PhpDocxTemplate(self::TEMPLATE1);
168
        $this->assertEquals(
169
            $reporter->buildXml(["object" => "world"]),
170
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
171
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" " .
172
            "xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" " .
173
            "xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" " .
174
            "xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\" " .
175
            "xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" " .
176
            "xmlns:cx4=\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" " .
177
            "xmlns:cx5=\"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\" " .
178
            "xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\" " .
179
            "xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" " .
180
            "xmlns:cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" " .
181
            "xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" " .
182
            "xmlns:aink=\"http://schemas.microsoft.com/office/drawing/2016/ink\" " .
183
            "xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" " .
184
            "xmlns:o=\"urn:schemas-microsoft-com:office:office\" " .
185
            "xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" " .
186
            "xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" " .
187
            "xmlns:v=\"urn:schemas-microsoft-com:vml\" " .
188
            "xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" " .
189
            "xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" " .
190
            "xmlns:w10=\"urn:schemas-microsoft-com:office:word\" " .
191
            "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" " .
192
            "xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" " .
193
            "xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" " .
194
            "xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\" " .
195
            "xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" " .
196
            "xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" " .
197
            "xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" " .
198
            "xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" " .
199
            "xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" " .
200
            "mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:p w14:paraId=\"504F2588\" " .
201
            "w14:textId=\"54DF26C8\" w:rsidR=\"0090657C\" w:rsidRPr=\"00FA3F61\" " .
202
            "w:rsidRDefault=\"00FA3F61\" w:rsidP=\"00C13DD6\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/>" .
203
            "</w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>Hello world!</w:t>" .
204
            "</w:r><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/><w:bookmarkEnd w:id=\"0\"/></w:p>" .
205
            "<w:sectPr w:rsidR=\"0090657C\" w:rsidRPr=\"00FA3F61\"><w:pgSz w:w=\"11906\" w:h=\"16838\"/>" .
206
            "<w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" w:left=\"1701\" w:header=\"708\" " .
207
            "w:footer=\"708\" w:gutter=\"0\"/><w:cols w:space=\"708\"/><w:docGrid w:linePitch=\"360\"/>" .
208
            "</w:sectPr></w:body></w:document>\n"
209
        );
210
        $reporter->close();
211
    }
212
213
    public function testRender(): void
214
    {
215
        $reporter = new PhpDocxTemplate(self::TEMPLATE2);
216
        $reporter->render(["one" => "1", "two" => "2", "three" => "3", "four" => "4"]);
217
        $this->assertEquals(
218
            $reporter->getXml(),
219
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
220
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:c" .
221
            "x=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" xmlns:cx1=\"http://schemas.microsoft." .
222
            "com/office/drawing/2015/9/8/chartex\" xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/1" .
223
            "0/21/chartex\" xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" xmlns:cx4=" .
224
            "\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" xmlns:cx5=\"http://schemas.microso" .
225
            "ft.com/office/drawing/2016/5/11/chartex\" xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/20" .
226
            "16/5/12/chartex\" xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" xmlns:" .
227
            "cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" xmlns:mc=\"http://schemas.open" .
228
            "xmlformats.org/markup-compatibility/2006\" xmlns:aink=\"http://schemas.microsoft.com/office/drawing/" .
229
            "2016/ink\" xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" xmlns:o=\"urn:sch" .
230
            "emas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/r" .
231
            "elationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:" .
232
            "schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessin" .
233
            "gDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns" .
234
            ":w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordproce" .
235
            "ssingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"h" .
236
            "ttp://schemas.microsoft.com/office/word/2012/wordml\" xmlns:w16cid=\"http://schemas.microsoft.com/of" .
237
            "fice/word/2016/wordml/cid\" xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex" .
238
            "\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http:" .
239
            "//schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.co" .
240
            "m/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessing" .
241
            "Shape\" mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:tbl><w:tblPr><w:tblStyle w:val=\"a3\"/" .
242
            "><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblLook w:val=\"04A0\" w:firstRow=\"1\" w:lastRow=\"0\" w:fir" .
243
            "stColumn=\"1\" w:lastColumn=\"0\" w:noHBand=\"0\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w" .
244
            ":w=\"3115\"/><w:gridCol w:w=\"3115\"/><w:gridCol w:w=\"3115\"/></w:tblGrid><w:tr w:rsidR=\"00031864" .
245
            "\" w14:paraId=\"73B274FD\" w14:textId=\"77777777\" w:rsidTr=\"00135B64\"><w:tc><w:tcPr><w:tcW w:w=\"3" .
246
            "115\" w:type=\"dxa\"/></w:tcPr><w:p w14:paraId=\"29117FB3\" w14:textId=\"713E58B3\" w:rsidR=\"000318" .
247
            "64\" w:rsidRPr=\"0033062B\" w:rsidRDefault=\"00031864\" w:rsidP=\"0033062B\"><w:pPr><w:rPr><w:lang w" .
248
            ":val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>1</w:t></w:r></w:p" .
249
            "></w:tc><w:tc><w:tcPr><w:tcW w:w=\"6230\" w:type=\"dxa\"/><w:gridSpan w:val=\"2\"/></w:tcPr><w:p w14" .
250
            ":paraId=\"4620CF03\" w14:textId=\"7FD6FF29\" w:rsidR=\"00031864\" w:rsidRPr=\"00B6314C\" w:rsidRDefa" .
251
            "ult=\"00B6314C\" w:rsidP=\"0033062B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w" .
252
            ":rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>1</w:t></w:r></w:p></w:tc></w:tr><w:tr w:rsidR=\"00031864" .
253
            "\" w14:paraId=\"638CAE21\" w14:textId=\"77777777\" w:rsidTr=\"0033062B\"><w:tc><w:tcPr><w:tcW w:w=\"" .
254
            "3115\" w:type=\"dxa\"/><w:vMerge w:val=\"restart\"/></w:tcPr><w:p w14:paraId=\"69D3958C\" w14:textId" .
255
            "=\"77777777\" w:rsidR=\"00031864\" w:rsidRPr=\"0033062B\" w:rsidRDefault=\"00031864\" w:rsidP=\"0033" .
256
            "062B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/><" .
257
            "/w:rPr><w:t>2</w:t></w:r></w:p><w:p w14:paraId=\"203EF204\" w14:textId=\"751D091A\" w:rsidR=\"000318" .
258
            "64\" w:rsidRPr=\"0033062B\" w:rsidRDefault=\"00031864\" w:rsidP=\"0033062B\"><w:pPr><w:rPr><w:lang w" .
259
            ":val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>3</w:t></w:r></w:p" .
260
            "></w:tc><w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=\"dxa\"/></w:tcPr><w:p w14:paraId=\"29D750B5\" w14:" .
261
            "textId=\"52111D71\" w:rsidR=\"00031864\" w:rsidRPr=\"00B6314C\" w:rsidRDefault=\"00B6314C\" w:rsidP=" .
262
            "\"0033062B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-U" .
263
            "S\"/></w:rPr><w:t>2</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=\"dxa\"/></w:tc" .
264
            "Pr><w:p w14:paraId=\"443FEDA5\" w14:textId=\"77777777\" w:rsidR=\"00031864\" w:rsidRDefault=\"000318" .
265
            "64\" w:rsidP=\"0033062B\"/></w:tc></w:tr><w:tr w:rsidR=\"00031864\" w14:paraId=\"3400FAC6\" w14:text" .
266
            "Id=\"77777777\" w:rsidTr=\"0033062B\"><w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=\"dxa\"/><w:vMerge/><" .
267
            "/w:tcPr><w:p w14:paraId=\"27010401\" w14:textId=\"299C3CC2\" w:rsidR=\"00031864\" w:rsidRPr=\"003306" .
268
            "2B\" w:rsidRDefault=\"00031864\" w:rsidP=\"0033062B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr" .
269
            "></w:pPr></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=\"dxa\"/></w:tcPr><w:p w14:paraId=\"6" .
270
            "D034FEF\" w14:textId=\"6465FA34\" w:rsidR=\"00031864\" w:rsidRPr=\"00B6314C\" w:rsidRDefault=\"00B63" .
271
            "14C\" w:rsidP=\"0033062B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lan" .
272
            "g w:val=\"en-US\"/></w:rPr><w:t>3</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=" .
273
            "\"dxa\"/></w:tcPr><w:p w14:paraId=\"331E7F28\" w14:textId=\"77777777\" w:rsidR=\"00031864\" w:rsidRDe" .
274
            "fault=\"00031864\" w:rsidP=\"0033062B\"/></w:tc></w:tr><w:tr w:rsidR=\"0033062B\" w14:paraId=\"489E0" .
275
            "54E\" w14:textId=\"77777777\" w:rsidTr=\"0033062B\"><w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=\"dxa\"" .
276
            "/></w:tcPr><w:p w14:paraId=\"24A13E38\" w14:textId=\"18E3B4BC\" w:rsidR=\"0033062B\" w:rsidRPr=\"003" .
277
            "3062B\" w:rsidRDefault=\"0033062B\" w:rsidP=\"0033062B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:" .
278
            "rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>4</w:t></w:r></w:p></w:tc><w:tc><w:tcP" .
279
            "r><w:tcW w:w=\"3115\" w:type=\"dxa\"/></w:tcPr><w:p w14:paraId=\"58DCBE56\" w14:textId=\"5D680B0D\" " .
280
            "w:rsidR=\"0033062B\" w:rsidRPr=\"00B6314C\" w:rsidRDefault=\"00B6314C\" w:rsidP=\"0033062B\"><w:pPr>" .
281
            "<w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>4<" .
282
            "/w:t></w:r><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/><w:bookmarkEnd w:id=\"0\"/></w:p></w:tc><" .
283
            "w:tc><w:tcPr><w:tcW w:w=\"3115\" w:type=\"dxa\"/></w:tcPr><w:p w14:paraId=\"277EDAD6\" w14:textId=\"" .
284
            "77777777\" w:rsidR=\"0033062B\" w:rsidRDefault=\"0033062B\" w:rsidP=\"0033062B\"/></w:tc></w:tr></w:" .
285
            "tbl><w:p w14:paraId=\"504F2588\" w14:textId=\"658244D8\" w:rsidR=\"0090657C\" w:rsidRPr=\"0033062B\"" .
286
            " w:rsidRDefault=\"0090657C\" w:rsidP=\"0033062B\"/><w:sectPr w:rsidR=\"0090657C\" w:rsidRPr=\"003306" .
287
            "2B\"><w:pgSz w:w=\"11906\" w:h=\"16838\"/><w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" " .
288
            "w:left=\"1701\" w:header=\"708\" w:footer=\"708\" w:gutter=\"0\"/><w:cols w:space=\"708\"/><w:docGri" .
289
            "d w:linePitch=\"360\"/></w:sectPr></w:body></w:document>\n"
290
        );
291
        $reporter->save(sys_get_temp_dir() . "/test.docx");
292
    }
293
294
    public function testLineBreak(): void
295
    {
296
        $reporter = new PhpDocxTemplate(self::TEMPLATE3);
297
        $reporter->render(["один" => "значение с \n переносом строки"]);
298
        $this->assertEquals(
299
            $reporter->getXml(),
300
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
301
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:c" .
302
            "x=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" xmlns:cx1=\"http://schemas.microsoft." .
303
            "com/office/drawing/2015/9/8/chartex\" xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/1" .
304
            "0/21/chartex\" xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" xmlns:cx4=" .
305
            "\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" xmlns:cx5=\"http://schemas.microso" .
306
            "ft.com/office/drawing/2016/5/11/chartex\" xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/20" .
307
            "16/5/12/chartex\" xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" xmlns:" .
308
            "cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" xmlns:mc=\"http://schemas.open" .
309
            "xmlformats.org/markup-compatibility/2006\" xmlns:aink=\"http://schemas.microsoft.com/office/drawing/" .
310
            "2016/ink\" xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" xmlns:o=\"urn:sch" .
311
            "emas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/r" .
312
            "elationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:" .
313
            "schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessin" .
314
            "gDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns" .
315
            ":w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordproce" .
316
            "ssingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"h" .
317
            "ttp://schemas.microsoft.com/office/word/2012/wordml\" xmlns:w16cid=\"http://schemas.microsoft.com/of" .
318
            "fice/word/2016/wordml/cid\" xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex" .
319
            "\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http:" .
320
            "//schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.co" .
321
            "m/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessing" .
322
            "Shape\" mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:p w14:paraId=\"504F2588\" w14:textId=" .
323
            "\"0B366F38\" w:rsidR=\"0090657C\" w:rsidRPr=\"00BC38E6\" w:rsidRDefault=\"00BC38E6\" w:rsidP=\"003306" .
324
            "2B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w" .
325
            ":rPr><w:t xml:space=\"preserve\">значение с </w:t></w:r></w:p><w:p><w:pPr><w:rPr><w:lang w:val=\"en-U" .
326
            "S\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t xml:space=\"preserve\">" .
327
            " переносом строки</w:t></w:r><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/>" .
328
            "<w:bookmarkEnd w:id=\"0\"/></w:p><w:sectPr w:rsidR=\"0090657C\" w:rsidRPr=\"00BC38E6\"><w:pgSz w:w=\"" .
329
            "11906\" w:h=\"16838\"/><w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" w:left=\"1701\" w:he" .
330
            "ader=\"708\" w:footer=\"708\" w:gutter=\"0\"/><w:cols w:space=\"708\"/><w:docGrid w:linePitch=\"360\"/><" .
331
            "/w:sectPr></w:body></w:document>\n"
332
        );
333
    }
334
335
    public function testCyrillic(): void
336
    {
337
        $reporter = new PhpDocxTemplate(self::TEMPLATE3);
338
        $reporter->render(["один" => "значение"]);
339
        $this->assertEquals(
340
            $reporter->getXml(),
341
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
342
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:c" .
343
            "x=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" xmlns:cx1=\"http://schemas.microsoft." .
344
            "com/office/drawing/2015/9/8/chartex\" xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/1" .
345
            "0/21/chartex\" xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" xmlns:cx4=" .
346
            "\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" xmlns:cx5=\"http://schemas.microso" .
347
            "ft.com/office/drawing/2016/5/11/chartex\" xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/20" .
348
            "16/5/12/chartex\" xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" xmlns:" .
349
            "cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" xmlns:mc=\"http://schemas.open" .
350
            "xmlformats.org/markup-compatibility/2006\" xmlns:aink=\"http://schemas.microsoft.com/office/drawing/" .
351
            "2016/ink\" xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" xmlns:o=\"urn:sch" .
352
            "emas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/r" .
353
            "elationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:" .
354
            "schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessin" .
355
            "gDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns" .
356
            ":w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordproce" .
357
            "ssingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"h" .
358
            "ttp://schemas.microsoft.com/office/word/2012/wordml\" xmlns:w16cid=\"http://schemas.microsoft.com/of" .
359
            "fice/word/2016/wordml/cid\" xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex" .
360
            "\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http:" .
361
            "//schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.co" .
362
            "m/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessing" .
363
            "Shape\" mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:p w14:paraId=\"504F2588\" w14:textId=" .
364
            "\"0B366F38\" w:rsidR=\"0090657C\" w:rsidRPr=\"00BC38E6\" w:rsidRDefault=\"00BC38E6\" w:rsidP=\"003306" .
365
            "2B\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/></w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w" .
366
            ":rPr><w:t xml:space=\"preserve\">значение</w:t></w:r><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/>" .
367
            "<w:bookmarkEnd w:id=\"0\"/></w:p><w:sectPr w:rsidR=\"0090657C\" w:rsidRPr=\"00BC38E6\"><w:pgSz w:w=\"" .
368
            "11906\" w:h=\"16838\"/><w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" w:left=\"1701\" w:he" .
369
            "ader=\"708\" w:footer=\"708\" w:gutter=\"0\"/><w:cols w:space=\"708\"/><w:docGrid w:linePitch=\"360\"/><" .
370
            "/w:sectPr></w:body></w:document>\n"
371
        );
372
    }
373
374
    public function testForLoop(): void
375
    {
376
        $reporter = new PhpDocxTemplate(self::TEMPLATE4);
377
        $reporter->render(["сотрудники" => [
378
            [
379
                "фамилия" => "Иванов",
380
                "имя" => "Иван",
381
                "отчество" => "Иванович",
382
                "дети" => [
383
                    [
384
                        "фамилия" => "Иванова",
385
                        "имя" => "Алена",
386
                        "отчество" => "Ивановна",
387
                        "возраст" => 25
388
                    ],
389
                    [
390
                        "фамилия" => "Иванов",
391
                        "имя" => "Михаил",
392
                        "отчество" => "Иванович",
393
                        "возраст" => 6
394
                    ]
395
                ],
396
                "возраст" => 50
397
            ],
398
            [
399
                "фамилия" => "Петров",
400
                "имя" => "Петр",
401
                "отчество" => "Петрович",
402
                "возраст" => 30
403
            ]
404
        ]]);
405
        $this->assertEquals(
406
            $reporter->getXml(),
407
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
408
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:c" .
409
            "x=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" xmlns:cx1=\"http://schemas.microsoft." .
410
            "com/office/drawing/2015/9/8/chartex\" xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/1" .
411
            "0/21/chartex\" xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" xmlns:cx4=" .
412
            "\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" xmlns:cx5=\"http://schemas.microso" .
413
            "ft.com/office/drawing/2016/5/11/chartex\" xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/20" .
414
            "16/5/12/chartex\" xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" xmlns:" .
415
            "cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" xmlns:mc=\"http://schemas.open" .
416
            "xmlformats.org/markup-compatibility/2006\" xmlns:aink=\"http://schemas.microsoft.com/office/drawing/" .
417
            "2016/ink\" xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" xmlns:o=\"urn:sch" .
418
            "emas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/r" .
419
            "elationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:" .
420
            "schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessin" .
421
            "gDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns" .
422
            ":w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordproce" .
423
            "ssingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"h" .
424
            "ttp://schemas.microsoft.com/office/word/2012/wordml\" xmlns:w16cid=\"http://schemas.microsoft.com/of" .
425
            "fice/word/2016/wordml/cid\" xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex" .
426
            "\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http:" .
427
            "//schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.co" .
428
            "m/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessing" .
429
            "Shape\" mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:p w14:paraId=\"45D5C362\" w14:textId=" .
430
            "\"79C82D83\" w:rsidR=\"00AF4B5B\" w:rsidRDefault=\"005D75A1\" w:rsidP=\"006B0D50\"><w:pPr><w:pStyle w" .
431
            ":val=\"a4\"/><w:numPr><w:ilvl w:val=\"0\"/><w:numId w:val=\"2\"/></w:numPr></w:pPr><w:proofErr w:typ" .
432
            "e=\"gramStart\"/><w:r w:rsidRPr=\"005D75A1\"><w:t xml:space=\"preserve\">Иванов Иван Иванович</w:t><" .
433
            "/w:r><w:r w:rsidR=\"00FE09C8\" w:rsidRPr=\"00FE09C8\"><w:t xml:space=\"preserve\">, </w:t></w:r><w:r" .
434
            " w:rsidR=\"00FE09C8\"><w:t>возраст</w:t></w:r><w:r w:rsidR=\"00FE09C8\" w:rsidRPr=\"00FE09C8\"><w:t>" .
435
            ":</w:t></w:r><w:r w:rsidR=\"005E422E\"><w:t xml:space=\"preserve\"> </w:t></w:r><w:r w:rsidR=\"005E4" .
436
            "22E\" w:rsidRPr=\"00DE2B94\"><w:t>50</w:t></w:r></w:p><w:p w14:paraId=\"78D1FA3D\" w14:textId=\"55EF" .
437
            "7A47\" w:rsidR=\"00AF4B5B\" w:rsidRDefault=\"00DE2B94\" w:rsidP=\"0031223E\"><w:pPr><w:pStyle w:val=" .
438
            "\"a4\"/></w:pPr><w:r><w:t xml:space=\"preserve\">- </w:t></w:r><w:proofErr w:type=\"gramStart\"/><w:" .
439
            "r w:rsidRPr=\"00DE2B94\"><w:t xml:space=\"preserve\">Иванова Алена Ивановна</w:t></w:r><w:r w:rsidR=" .
440
            "\"00126257\" w:rsidRPr=\"00126257\"><w:t xml:space=\"preserve\"> </w:t></w:r></w:p><w:p w14:paraId=" .
441
            "\"78D1FA3D\" w14:textId=\"55EF7A47\" w:rsidR=\"00AF4B5B\" w:rsidRDefault=\"00DE2B94\" w:rsidP=\"00312" .
442
            "23E\"><w:pPr><w:pStyle w:val=\"a4\"/></w:pPr><w:r><w:t xml:space=\"preserve\">- </w:t></w:r><w:proofErr " .
443
            "w:type=\"gramStart\"/><w:r w:rsidRPr=\"00DE2B94\"><w:t xml:space=\"preserve\">Иванов Михаил Иванович" .
444
            "</w:t></w:r><w:r w:rsidR=\"00126257\" w:rsidRPr=\"00126257\"><w:t xml:space=\"preserve\"> </w:t></w:" .
445
            "r></w:p><w:p w14:paraId=\"45D5C362\" w14:textId=\"79C82D83\" w:rsidR=\"00AF4B5B\" w:rsidRDefault=\"0" .
446
            "05D75A1\" w:rsidP=\"006B0D50\"><w:pPr><w:pStyle w:val=\"a4\"/><w:numPr><w:ilvl w:val=\"0\"/><w:numId" .
447
            " w:val=\"2\"/></w:numPr></w:pPr><w:proofErr w:type=\"gramStart\"/><w:r w:rsidRPr=\"005D75A1\"><w:t x" .
448
            "ml:space=\"preserve\">Петров Петр Петрович</w:t></w:r><w:r w:rsidR=\"00FE09C8\" w:rsidRPr=\"00FE09C8" .
449
            "\"><w:t xml:space=\"preserve\">, </w:t></w:r><w:r w:rsidR=\"00FE09C8\"><w:t>возраст</w:t></w:r><w:r " .
450
            "w:rsidR=\"00FE09C8\" w:rsidRPr=\"00FE09C8\"><w:t>:</w:t></w:r><w:r w:rsidR=\"005E422E\"><w:t xml:spa" .
451
            "ce=\"preserve\"> </w:t></w:r><w:r w:rsidR=\"005E422E\" w:rsidRPr=\"00DE2B94\"><w:t>30</w:t></w:r></w" .
452
            ":p><w:p w14:paraId=\"4B66446E\" w14:textId=\"2D5C0B86\" w:rsidR=\"0024376E\" w:rsidRDefault=\"002437" .
453
            "6E\" w:rsidP=\"00AF4B5B\"/><w:p w14:paraId=\"3F32EC2C\" w14:textId=\"77777777\" w:rsidR=\"0024376E\"" .
454
            " w:rsidRPr=\"008D21C0\" w:rsidRDefault=\"0024376E\" w:rsidP=\"00AF4B5B\"/><w:sectPr w:rsidR=\"002437" .
455
            "6E\" w:rsidRPr=\"008D21C0\"><w:pgSz w:w=\"11906\" w:h=\"16838\"/><w:pgMar w:top=\"1134\" w:right=\"8" .
456
            "50\" w:bottom=\"1134\" w:left=\"1701\" w:header=\"708\" w:footer=\"708\" w:gutter=\"0\"/><w:cols w:s" .
457
            "pace=\"708\"/><w:docGrid w:linePitch=\"360\"/></w:sectPr></w:body></w:document>\n"
458
        );
459
    }
460
461
    public function testTable(): void
462
    {
463
        $reporter = new PhpDocxTemplate(self::TEMPLATE5);
464
        $reporter->render(["records" => [
465
            [
466
                "a" => "a1",
467
                "b" => "b1",
468
                "c" => "c1"
469
            ],
470
            [
471
                "a" => "a2",
472
                "b" => "b2",
473
                "c" => "c2"
474
            ]
475
        ]]);
476
477
        $this->assertEquals(
478
            $reporter->getXml(),
479
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
480
            "<w:document xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"><w:body><w:tbl>" .
481
            "<w:tblPr/><w:tblGrid><w:gridCol w:w=\"1526\"/><w:gridCol w:w=\"1843\"/><w:gridCol w:w=\"5919\"/></w:" .
482
            "tblGrid><w:tr><w:trPr><w:trHeight w:val=\"200\" w:hRule=\"auto\"/><w:jc w:val=\"left\"/></w:trPr><w:" .
483
            "tc><w:tcPr><w:tcW w:w=\"1526\" w:type=\"dxa\"/><w:tcBorders><w:top w:val=\"single\" w:color=\"000000" .
484
            "\" w:sz=\"4\"/><w:left w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:bottom w:val=\"single\" w:" .
485
            "color=\"000000\" w:sz=\"4\"/><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/></w:tcBorders>" .
486
            "<w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\"/><w:tcMar><w:left w:w=\"108\" w:type=\"d" .
487
            "xa\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tcMar><w:vAlign w:val=\"top\"/></w:tcPr><w:p><w:pPr><" .
488
            "w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\"/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine" .
489
            "=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibr" .
490
            "i\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"" .
491
            "/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts " .
492
            "w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"au" .
493
            "to\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:" .
494
            "val=\"clear\"/></w:rPr><w:t xml:space=\"preserve\">A</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:" .
495
            "w=\"1843\" w:type=\"dxa\"/><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:le" .
496
            "ft w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:bottom w:val=\"single\" w:color=\"000000\" w:s" .
497
            "z=\"4\"/><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/></w:tcBorders><w:shd w:color=\"000" .
498
            "000\" w:fill=\"ffffff\" w:val=\"clear\"/><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\"/><w:right w:w=\"" .
499
            "108\" w:type=\"dxa\"/></w:tcMar><w:vAlign w:val=\"top\"/></w:tcPr><w:p><w:pPr><w:spacing w:before=\"" .
500
            "0\" w:after=\"0\" w:line=\"240\"/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=" .
501
            "\"left\"/><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Cal" .
502
            "ibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"" .
503
            "/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" " .
504
            "w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:v" .
505
            "al=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:r" .
506
            "Pr><w:t xml:space=\"preserve\">B</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"5919\" w:type=\"" .
507
            "dxa\"/><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:left w:val=\"single\" " .
508
            "w:color=\"000000\" w:sz=\"4\"/><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:right w:" .
509
            "val=\"single\" w:color=\"000000\" w:sz=\"4\"/></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"fffff" .
510
            "f\" w:val=\"clear\"/><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"" .
511
            "/></w:tcMar><w:vAlign w:val=\"top\"/></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w" .
512
            ":line=\"240\"/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:" .
513
            "rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:v" .
514
            "al=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"au" .
515
            "to\" w:val=\"clear\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" " .
516
            "w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:positio" .
517
            "n w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr><w:t xml:space=\"" .
518
            "preserve\">C</w:t></w:r></w:p></w:tc></w:tr><w:tr><w:trPr><w:trHeight w:val=\"1\" w:hRule=\"atLeast\"" .
519
            "/><w:jc w:val=\"left\"/></w:trPr><w:tc><w:tcPr><w:tcW w:w=\"1526\" w:type=\"dxa\"/><w:tcBorders><w:" .
520
            "top w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:left w:val=\"single\" w:color=\"000000\" w:sz" .
521
            "=\"4\"/><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:right w:val=\"single\" w:color=" .
522
            "\"000000\" w:sz=\"4\"/></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\"/><w" .
523
            ":tcMar><w:left w:w=\"108\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tcMar><w:vAlign " .
524
            "w:val=\"top\"/></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\"/><w:ind w" .
525
            ":right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rFonts w:ascii=\"Calibr" .
526
            "i\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing" .
527
            " w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/><" .
528
            "/w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:east" .
529
            "Asia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:" .
530
            "val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr><w:t xml:space=\"preserve\">a1</w:t></w:" .
531
            "r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"1843\" w:type=\"dxa\"/><w:tcBorders><w:top w:val=\"single\"" .
532
            " w:color=\"000000\" w:sz=\"4\"/><w:left w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:bottom w" .
533
            ":val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4" .
534
            "\"/></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\"/><w:tcMar><w:left w:w=" .
535
            "\"108\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tcMar><w:vAlign w:val=\"top\"/></w:" .
536
            "tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\"/><w:ind w:right=\"0\" w:left" .
537
            "=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calib" .
538
            "ri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:po" .
539
            "sition w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr></w:pPr><w:r" .
540
            "><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><" .
541
            "w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd " .
542
            "w:fill=\"auto\" w:val=\"clear\"/></w:rPr><w:t xml:space=\"preserve\">b1</w:t></w:r></w:p></w:tc><w:t" .
543
            "c><w:tcPr><w:tcW w:w=\"5919\" w:type=\"dxa\"/><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\"" .
544
            " w:sz=\"4\"/><w:left w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:bottom w:val=\"single\" w:c" .
545
            "olor=\"000000\" w:sz=\"4\"/><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/></w:tcBorders><" .
546
            "w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\"/><w:tcMar><w:left w:w=\"108\" w:type=\"dx" .
547
            "a\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tcMar><w:vAlign w:val=\"top\"/></w:tcPr><w:p><w:pPr><w" .
548
            ":spacing w:before=\"0\" w:after=\"0\" w:line=\"240\"/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=" .
549
            "\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri" .
550
            "\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/" .
551
            "><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w" .
552
            ":ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"aut" .
553
            "o\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:v" .
554
            "al=\"clear\"/></w:rPr><w:t xml:space=\"preserve\">c1</w:t></w:r></w:p></w:tc></w:tr><w:tr><w:trPr><w" .
555
            ":trHeight w:val=\"1\" w:hRule=\"atLeast\"/><w:jc w:val=\"left\"/></w:trPr><w:tc><w:tcPr><w:tcW w:w=\"" .
556
            "1526\" w:type=\"dxa\"/><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:left " .
557
            "w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"" .
558
            "4\"/><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/></w:tcBorders><w:shd w:color=\"000000" .
559
            "\" w:fill=\"ffffff\" w:val=\"clear\"/><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\"/><w:right w:w=\"10" .
560
            "8\" w:type=\"dxa\"/></w:tcMar><w:vAlign w:val=\"top\"/></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\"" .
561
            " w:after=\"0\" w:line=\"240\"/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"l" .
562
            "eft\"/><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibr" .
563
            "i\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><" .
564
            "w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:h" .
565
            "Ansi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=" .
566
            "\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr>" .
567
            "<w:t xml:space=\"preserve\">a2</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"1843\" w:type=\"dx" .
568
            "a\"/><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:left w:val=\"single\" w:" .
569
            "color=\"000000\" w:sz=\"4\"/><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:right w:va" .
570
            "l=\"single\" w:color=\"000000\" w:sz=\"4\"/></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\"" .
571
            " w:val=\"clear\"/><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"/" .
572
            "></w:tcMar><w:vAlign w:val=\"top\"/></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:l" .
573
            "ine=\"240\"/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rF" .
574
            "onts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val" .
575
            "=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto" .
576
            "\" w:val=\"clear\"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:" .
577
            "cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position " .
578
            "w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr><w:t xml:space=\"pr" .
579
            "eserve\">b2</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"5919\" w:type=\"dxa\"/><w:tcBorders><" .
580
            "w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:left w:val=\"single\" w:color=\"000000\" w:" .
581
            "sz=\"4\"/><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\"/><w:right w:val=\"single\" w:colo" .
582
            "r=\"000000\" w:sz=\"4\"/></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\"/>" .
583
            "<w:tcMar><w:left w:w=\"108\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tcMar><w:vAlig" .
584
            "n w:val=\"top\"/></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\"/><w:ind" .
585
            " w:right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rFonts w:ascii=\"Cali" .
586
            "bri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spaci" .
587
            "ng w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/" .
588
            "></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:ea" .
589
            "stAsia=\"Calibri\"/><w:color w:val=\"auto\"/><w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz " .
590
            "w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"clear\"/></w:rPr><w:t xml:space=\"preserve\">c2</w:t></" .
591
            "w:r></w:p></w:tc></w:tr></w:tbl><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"200\" w:line=\"276\"" .
592
            "/><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\"/><w:jc w:val=\"left\"/><w:rPr><w:rFonts w:asci" .
593
            "i=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"/><w:color w:val=\"auto\"/>" .
594
            "<w:spacing w:val=\"0\"/><w:position w:val=\"0\"/><w:sz w:val=\"22\"/><w:shd w:fill=\"auto\" w:val=\"" .
595
            "clear\"/></w:rPr></w:pPr></w:p></w:body></w:document>\n"
596
        );
597
598
        $this->assertEquals(
599
            $reporter->getDocx()->getDocumentMainPart(),
600
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:document xmlns:w=\"http://schemas.op" .
601
            "enxmlformats.org/wordprocessingml/2006/main\"><w:body><w:tbl><w:tblPr /><w:tblGrid><w:gridCol w:w=\"" .
602
            "1526\" /><w:gridCol w:w=\"1843\" /><w:gridCol w:w=\"5919\" /></w:tblGrid><w:tr><w:trPr><w:trHeight w" .
603
            ":val=\"200\" w:hRule=\"auto\" /><w:jc w:val=\"left\" /></w:trPr><w:tc><w:tcPr><w:tcW w:w=\"1526\" w:" .
604
            "type=\"dxa\" /><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:left w:val=\"" .
605
            "single\" w:color=\"000000\" w:sz=\"4\" /><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\" />" .
606
            "<w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /></w:tcBorders><w:shd w:color=\"000000\" w:" .
607
            "fill=\"ffffff\" w:val=\"clear\" /><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\" /><w:right w:w=\"108\"" .
608
            " w:type=\"dxa\" /></w:tcMar><w:vAlign w:val=\"top\" /></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\"" .
609
            " w:after=\"0\" w:line=\"240\" /><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc w:val=\"" .
610
            "left\" /><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Cali" .
611
            "bri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"2" .
612
            "2\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calib" .
613
            "ri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:spac" .
614
            "ing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clea" .
615
            "r\" /></w:rPr><w:t xml:space=\"preserve\">A</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"1843\"" .
616
            " w:type=\"dxa\" /><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:left w:va" .
617
            "l=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\"" .
618
            " /><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /></w:tcBorders><w:shd w:color=\"000000\"" .
619
            " w:fill=\"ffffff\" w:val=\"clear\" /><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\" /><w:right w:w=\"1" .
620
            "08\" w:type=\"dxa\" /></w:tcMar><w:vAlign w:val=\"top\" /></w:tcPr><w:p><w:pPr><w:spacing w:before=\"" .
621
            "0\" w:after=\"0\" w:line=\"240\" /><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc w:va" .
622
            "l=\"left\" /><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"" .
623
            "Calibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val" .
624
            "=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"C" .
625
            "alibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:" .
626
            "spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"" .
627
            "clear\" /></w:rPr><w:t xml:space=\"preserve\">B</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"5" .
628
            "919\" w:type=\"dxa\" /><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:left " .
629
            "w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=" .
630
            "\"4\" /><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /></w:tcBorders><w:shd w:color=\"000" .
631
            "000\" w:fill=\"ffffff\" w:val=\"clear\" /><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\" /><w:right w:w" .
632
            "=\"108\" w:type=\"dxa\" /></w:tcMar><w:vAlign w:val=\"top\" /></w:tcPr><w:p><w:pPr><w:spacing w:befo" .
633
            "re=\"0\" w:after=\"0\" w:line=\"240\" /><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc " .
634
            "w:val=\"left\" /><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsi" .
635
            "a=\"Calibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w" .
636
            ":val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii" .
637
            "=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /" .
638
            "><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:va" .
639
            "l=\"clear\" /></w:rPr><w:t xml:space=\"preserve\">C</w:t></w:r></w:p></w:tc></w:tr><w:tr><w:trPr><w:" .
640
            "trHeight w:val=\"1\" w:hRule=\"atLeast\" /><w:jc w:val=\"left\" /></w:trPr><w:tc><w:tcPr><w:tcW w:w=" .
641
            "\"9288\" w:type=\"dxa\" /><w:gridSpan w:val=\"3\" /><w:tcBorders><w:top w:val=\"single\" w:color=\"0" .
642
            "00000\" w:sz=\"4\" /><w:left w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:bottom w:val=\"sing" .
643
            "le\" w:color=\"000000\" w:sz=\"4\" /><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /></w:t" .
644
            "cBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\" /><w:tcMar><w:left w:w=\"108\" " .
645
            "w:type=\"dxa\" /><w:right w:w=\"108\" w:type=\"dxa\" /></w:tcMar><w:vAlign w:val=\"top\" /></w:tcPr>" .
646
            "<w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" /><w:ind w:right=\"0\" w:left=\"0" .
647
            "\" w:firstLine=\"0\" /><w:jc w:val=\"left\" /><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri" .
648
            "\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:p" .
649
            "osition w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr></w:pPr>" .
650
            "<w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\"" .
651
            " /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" " .
652
            "/><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr><w:t xml:space=\"preserve\">{%tr for record in re" .
653
            "cords %}</w:t></w:r></w:p></w:tc></w:tr><w:tr><w:trPr><w:trHeight w:val=\"1\" w:hRule=\"atLeast\" />" .
654
            "<w:jc w:val=\"left\" /></w:trPr><w:tc><w:tcPr><w:tcW w:w=\"1526\" w:type=\"dxa\" /><w:tcBorders><w:t" .
655
            "op w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:left w:val=\"single\" w:color=\"000000\" w:sz" .
656
            "=\"4\" /><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:right w:val=\"single\" w:colo" .
657
            "r=\"000000\" w:sz=\"4\" /></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\" " .
658
            "/><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\" /><w:right w:w=\"108\" w:type=\"dxa\" /></w:tcMar><w:v" .
659
            "Align w:val=\"top\" /></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" />" .
660
            "<w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc w:val=\"left\" /><w:rPr><w:rFonts w:asci" .
661
            "i=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" " .
662
            "/><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:v" .
663
            "al=\"clear\" /></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"" .
664
            "Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:" .
665
            "val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr><w:t xml:space=\"p" .
666
            "reserve\">{{ record.a }}</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"1843\" w:type=\"dxa\" />" .
667
            "<w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:left w:val=\"single\" w:colo" .
668
            "r=\"000000\" w:sz=\"4\" /><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:right w:val=" .
669
            "\"single\" w:color=\"000000\" w:sz=\"4\" /></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\"" .
670
            " w:val=\"clear\" /><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\" /><w:right w:w=\"108\" w:type=\"dxa\"" .
671
            " /></w:tcMar><w:vAlign w:val=\"top\" /></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" " .
672
            "w:line=\"240\" /><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc w:val=\"left\" /><w:rPr" .
673
            "><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:colo" .
674
            "r w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:" .
675
            "fill=\"auto\" w:val=\"clear\" /></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"" .
676
            "Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\"" .
677
            " /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr><" .
678
            "w:t xml:space=\"preserve\">{{ record.b }}</w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w=\"5919\" " .
679
            "w:type=\"dxa\" /><w:tcBorders><w:top w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:left w:val=" .
680
            "\"single\" w:color=\"000000\" w:sz=\"4\" /><w:bottom w:val=\"single\" w:color=\"000000\" w:sz=\"4\" " .
681
            "/><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /></w:tcBorders><w:shd w:color=\"000000\" " .
682
            "w:fill=\"ffffff\" w:val=\"clear\" /><w:tcMar><w:left w:w=\"108\" w:type=\"dxa\" /><w:right w:w=\"108" .
683
            "\" w:type=\"dxa\" /></w:tcMar><w:vAlign w:val=\"top\" /></w:tcPr><w:p><w:pPr><w:spacing w:before=\"0" .
684
            "\" w:after=\"0\" w:line=\"240\" /><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc w:val=" .
685
            "\"left\" /><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Ca" .
686
            "libri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"" .
687
            "22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Cal" .
688
            "ibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:sp" .
689
            "acing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"cl" .
690
            "ear\" /></w:rPr><w:t xml:space=\"preserve\">{{ record.c }}</w:t></w:r></w:p></w:tc></w:tr><w:tr><w:t" .
691
            "rPr><w:trHeight w:val=\"1\" w:hRule=\"atLeast\" /><w:jc w:val=\"left\" /></w:trPr><w:tc><w:tcPr><w:t" .
692
            "cW w:w=\"9288\" w:type=\"dxa\" /><w:gridSpan w:val=\"3\" /><w:tcBorders><w:top w:val=\"single\" w:co" .
693
            "lor=\"000000\" w:sz=\"4\" /><w:left w:val=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:bottom w:val" .
694
            "=\"single\" w:color=\"000000\" w:sz=\"4\" /><w:right w:val=\"single\" w:color=\"000000\" w:sz=\"4\" " .
695
            "/></w:tcBorders><w:shd w:color=\"000000\" w:fill=\"ffffff\" w:val=\"clear\" /><w:tcMar><w:left w:w=\"" .
696
            "108\" w:type=\"dxa\" /><w:right w:w=\"108\" w:type=\"dxa\" /></w:tcMar><w:vAlign w:val=\"top\" /></" .
697
            "w:tcPr><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"0\" w:line=\"240\" /><w:ind w:right=\"0\" w:l" .
698
            "eft=\"0\" w:firstLine=\"0\" /><w:jc w:val=\"left\" /><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"" .
699
            "Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\"" .
700
            " /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr><" .
701
            "/w:pPr><w:r><w:rPr><w:rFonts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"C" .
702
            "alibri\" /><w:color w:val=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=" .
703
            "\"22\" /><w:shd w:fill=\"auto\" w:val=\"clear\" /></w:rPr><w:t xml:space=\"preserve\">{%tr endfor %}" .
704
            "</w:t></w:r></w:p></w:tc></w:tr></w:tbl><w:p><w:pPr><w:spacing w:before=\"0\" w:after=\"200\" w:line" .
705
            "=\"276\" /><w:ind w:right=\"0\" w:left=\"0\" w:firstLine=\"0\" /><w:jc w:val=\"left\" /><w:rPr><w:rF" .
706
            "onts w:ascii=\"Calibri\" w:hAnsi=\"Calibri\" w:cs=\"Calibri\" w:eastAsia=\"Calibri\" /><w:color w:va" .
707
            "l=\"auto\" /><w:spacing w:val=\"0\" /><w:position w:val=\"0\" /><w:sz w:val=\"22\" /><w:shd w:fill=\"" .
708
            "auto\" w:val=\"clear\" /></w:rPr></w:pPr></w:p></w:body></w:document>"
709
        );
710
    }
711
712
    public function testImages(): void
713
    {
714
        $reporter = new PhpDocxTemplate(self::TEMPLATE8);
715
716
        $reporter->render(["records" => [
717
            [
718
                "a" => "a1",
719
                "b" => "b1",
720
                "c" => "https://www.google.ru",
721
                "d" => __DIR__ . "/images/planet1.png"
722
            ],
723
            [
724
                "a" => "a2",
725
                "b" => "b2",
726
                "c" => "https://yandex.ru/",
727
                "d" => __DIR__ . "/images/planet2.png"
728
            ],
729
            [
730
                "a" => "a3",
731
                "b" => "b2",
732
                "c" => "https://mail.ru/",
733
                "d" => __DIR__ . "/images/planet3.png"
734
            ]
735
        ]]);
736
737
        $docName = "./tests/templates/image.docx";
738
739
        $reporter->save($docName);
740
741
        $expectedDocumentZip = new ZipArchive();
742
        $expectedDocumentZip->open($docName);
743
        $expectedContentTypesXml = $expectedDocumentZip->getFromName('[Content_Types].xml');
0 ignored issues
show
Unused Code introduced by
The assignment to $expectedContentTypesXml is dead and can be removed.
Loading history...
744
        $expectedDocumentRelationsXml = $expectedDocumentZip->getFromName('word/_rels/document.xml.rels');
0 ignored issues
show
Unused Code introduced by
The assignment to $expectedDocumentRelationsXml is dead and can be removed.
Loading history...
745
        $expectedMainPartXml = $expectedDocumentZip->getFromName('word/document.xml');
0 ignored issues
show
Unused Code introduced by
The assignment to $expectedMainPartXml is dead and can be removed.
Loading history...
746
        $expectedImage = $expectedDocumentZip->getFromName('word/media/image_rId5_document.png');
747
        if (false === $expectedDocumentZip->close()) {
748
            throw new \Exception("Could not close zip file \"{$docName}\".");
749
        }
750
751
        $this->assertNotEmpty($expectedImage, 'Embed image doesn\'t found.');
752
    }
753
754
    public function testSections(): void
755
    {
756
        $reporter = new PhpDocxTemplate(self::TEMPLATE9);
757
       /* $this->assertEquals(
758
            $reporter->buildXml(["object" => "world"]),
759
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" .
760
            "<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" " .
761
            "xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" " .
762
            "xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" " .
763
            "xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\" " .
764
            "xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" " .
765
            "xmlns:cx4=\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" " .
766
            "xmlns:cx5=\"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\" " .
767
            "xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\" " .
768
            "xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" " .
769
            "xmlns:cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" " .
770
            "xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" " .
771
            "xmlns:aink=\"http://schemas.microsoft.com/office/drawing/2016/ink\" " .
772
            "xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" " .
773
            "xmlns:o=\"urn:schemas-microsoft-com:office:office\" " .
774
            "xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" " .
775
            "xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" " .
776
            "xmlns:v=\"urn:schemas-microsoft-com:vml\" " .
777
            "xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" " .
778
            "xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" " .
779
            "xmlns:w10=\"urn:schemas-microsoft-com:office:word\" " .
780
            "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" " .
781
            "xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" " .
782
            "xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" " .
783
            "xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\" " .
784
            "xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" " .
785
            "xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" " .
786
            "xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" " .
787
            "xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" " .
788
            "xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" " .
789
            "mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body><w:p w14:paraId=\"504F2588\" " .
790
            "w14:textId=\"54DF26C8\" w:rsidR=\"0090657C\" w:rsidRPr=\"00FA3F61\" " .
791
            "w:rsidRDefault=\"00FA3F61\" w:rsidP=\"00C13DD6\"><w:pPr><w:rPr><w:lang w:val=\"en-US\"/>" .
792
            "</w:rPr></w:pPr><w:r><w:rPr><w:lang w:val=\"en-US\"/></w:rPr><w:t>Hello world!</w:t>" .
793
            "</w:r><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/><w:bookmarkEnd w:id=\"0\"/></w:p>" .
794
            "<w:sectPr w:rsidR=\"0090657C\" w:rsidRPr=\"00FA3F61\"><w:pgSz w:w=\"11906\" w:h=\"16838\"/>" .
795
            "<w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" w:left=\"1701\" w:header=\"708\" " .
796
            "w:footer=\"708\" w:gutter=\"0\"/><w:cols w:space=\"708\"/><w:docGrid w:linePitch=\"360\"/>" .
797
            "</w:sectPr></w:body></w:document>\n"
798
        );*/
799
        $docName = './doc9.docx';
800
        $reporter->render(["object" => "test", "section" => [["id" => "test section"]]]);
801
        $reporter->save($docName);
802
        // $reporter->close();
803
804
        $expectedDocumentZip = new ZipArchive();
805
        $expectedDocumentZip->open($docName);
806
        $header = $expectedDocumentZip->getFromName('word/header2.xml');
807
        $this->assertEquals('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . PHP_EOL .
808
'<w:hdr xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" ' .
809
            'xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1=' .
810
            '"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http:' .
811
            '//schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://sche' .
812
            'mas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.micro' .
813
            'soft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/' .
814
            'office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/dra' .
815
            'wing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5' .
816
            '/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex' .
817
            '" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="h' .
818
            'ttp://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.micros' .
819
            'oft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office"' .
820
            ' xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m' .
821
            '="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-mic' .
822
            'rosoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessi' .
823
            'ngDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDr' .
824
            'awing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openx' .
825
            'mlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/offi' .
826
            'ce/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" ' .
827
            'xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="' .
828
            'http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.mi' .
829
            'crosoft.com/office/word/2018/wordml" xmlns:w16sdtdh="http://schemas.microsoft.com/offi' .
830
            'ce/word/2020/wordml/sdtdatahash" xmlns:w16se="http://schemas.microsoft.com/office/word' .
831
            '/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordproce' .
832
            'ssingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk' .
833
            '" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://s' .
834
            'chemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se' .
835
            ' w16cid w16 w16cex w16sdtdh wp14"><w:p w14:paraId="41482033" w14:textId="76B90B7C" w:r' .
836
            'sidR="0023643A" w:rsidRPr="008D02AA" w:rsidRDefault="0023643A" w:rsidP="008D02AA"><w:r' .
837
            ' w:rsidRPr="008D02AA"><w:t xml:space="preserve">Opa </w:t></w:r><w:r w:rsidR="00AB4EBE' .
838
            '" w:rsidRPr="00AB4EBE"><w:t>test section</w:t></w:r></w:p></w:hdr>', $header);
839
    }
840
}
841