@@ -21,6 +21,9 @@ public function tearDown()
21
21
TestHelperDOCX::clear ();
22
22
}
23
23
24
+ /**
25
+ * covers ::_writeText
26
+ */
24
27
public function testWriteText ()
25
28
{
26
29
$ rStyle = 'rStyle ' ;
@@ -40,7 +43,7 @@ public function testWriteText()
40
43
}
41
44
42
45
/**
43
- * Write text run
46
+ * covers ::_writeTextRun
44
47
*/
45
48
public function testWriteTextRun ()
46
49
{
@@ -67,7 +70,7 @@ public function testWriteTextRun()
67
70
}
68
71
69
72
/**
70
- * Write link
73
+ * covers ::_writeLink
71
74
*/
72
75
public function testWriteLink ()
73
76
{
@@ -84,7 +87,7 @@ public function testWriteLink()
84
87
}
85
88
86
89
/**
87
- * Write preserve text
90
+ * covers ::_writePreserveText
88
91
*/
89
92
public function testWritePreserveText ()
90
93
{
@@ -102,7 +105,7 @@ public function testWritePreserveText()
102
105
}
103
106
104
107
/**
105
- * Write paragraph style: Alignment
108
+ * covers ::_writeParagraphStyle
106
109
*/
107
110
public function testWriteParagraphStyleAlign ()
108
111
{
@@ -118,7 +121,7 @@ public function testWriteParagraphStyleAlign()
118
121
}
119
122
120
123
/**
121
- * Write paragraph style: Pagination
124
+ * covers ::_writeParagraphStyle
122
125
*/
123
126
public function testWriteParagraphStylePagination ()
124
127
{
@@ -180,7 +183,7 @@ public function testWriteFontStyle()
180
183
}
181
184
182
185
/**
183
- * Write table
186
+ * covers ::_writeTableStyle
184
187
*/
185
188
public function testWriteTableStyle ()
186
189
{
@@ -238,7 +241,7 @@ public function testWriteTableStyle()
238
241
}
239
242
240
243
/**
241
- * Write cell style
244
+ * covers ::_writeCellStyle
242
245
*/
243
246
public function testWriteCellStyleCellGridSpan ()
244
247
{
@@ -265,7 +268,7 @@ public function testWriteCellStyleCellGridSpan()
265
268
}
266
269
267
270
/**
268
- * Write image
271
+ * covers ::_writeImage
269
272
*/
270
273
public function testWriteImagePosition ()
271
274
{
@@ -290,7 +293,27 @@ public function testWriteImagePosition()
290
293
}
291
294
292
295
/**
293
- * Write title
296
+ * covers ::_writeWatermark
297
+ */
298
+ public function testWriteWatermark ()
299
+ {
300
+ $ imageSrc = join (
301
+ DIRECTORY_SEPARATOR ,
302
+ array (PHPWORD_TESTS_DIR_ROOT , '_files ' , 'images ' , 'earth.jpg ' )
303
+ );
304
+
305
+ $ PHPWord = new PHPWord ();
306
+ $ section = $ PHPWord ->createSection ();
307
+ $ header = $ section ->createHeader ();
308
+ $ header ->addWatermark ($ imageSrc );
309
+ $ doc = TestHelperDOCX::getDocument ($ PHPWord );
310
+
311
+ $ element = $ doc ->getElement ("/w:document/w:body/w:sectPr/w:headerReference " );
312
+ $ this ->assertStringStartsWith ("rId " , $ element ->getAttribute ('r:id ' ));
313
+ }
314
+
315
+ /**
316
+ * covers ::_writeTitle
294
317
*/
295
318
public function testWriteTitle ()
296
319
{
0 commit comments