1
1
<?php
2
+ /**
3
+ * PHPWord
4
+ *
5
+ * PHP version 5.3
6
+ *
7
+ * @copyright 2014 PHPWord
8
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
9
+ * @version 0.9.0
10
+ */
11
+
2
12
namespace PhpOffice \PhpWord \Tests ;
3
13
4
14
use PhpOffice \PhpWord \PhpWord ;
7
17
use PhpOffice \PhpWord \Style ;
8
18
9
19
/**
10
- * @coversDefaultClass \PhpOffice\PhpWord\PhpWord
20
+ * Test for PHPWord main class
21
+ *
22
+ * @coversDefaultClass \PhpOffice\PhpWord\PhpWord
11
23
* @runTestsInSeparateProcesses
12
24
*/
13
25
class PhpWordTest extends \PHPUnit_Framework_TestCase
14
26
{
15
27
/**
16
- * @covers ::__construct
28
+ * Test object creation
29
+ *
17
30
* @covers ::getDocumentProperties
18
31
* @covers ::getDefaultFontName
19
32
* @covers ::getDefaultFontSize
@@ -27,6 +40,8 @@ public function testConstruct()
27
40
}
28
41
29
42
/**
43
+ * Test set/get document properties
44
+ *
30
45
* @covers ::setDocumentProperties
31
46
* @covers ::getDocumentProperties
32
47
*/
@@ -41,6 +56,8 @@ public function testSetGetDocumentProperties()
41
56
}
42
57
43
58
/**
59
+ * Test create/get section
60
+ *
44
61
* @covers ::createSection
45
62
* @covers ::getSections
46
63
*/
@@ -53,6 +70,8 @@ public function testCreateGetSections()
53
70
}
54
71
55
72
/**
73
+ * Test set/get default font name
74
+ *
56
75
* @covers ::setDefaultFontName
57
76
* @covers ::getDefaultFontName
58
77
*/
@@ -66,6 +85,8 @@ public function testSetGetDefaultFontName()
66
85
}
67
86
68
87
/**
88
+ * Test set/get default font size
89
+ *
69
90
* @covers ::setDefaultFontSize
70
91
* @covers ::getDefaultFontSize
71
92
*/
@@ -79,6 +100,8 @@ public function testSetGetDefaultFontSize()
79
100
}
80
101
81
102
/**
103
+ * Test set default paragraph style
104
+ *
82
105
* @covers ::setDefaultParagraphStyle
83
106
* @covers ::loadTemplate
84
107
*/
@@ -90,6 +113,8 @@ public function testSetDefaultParagraphStyle()
90
113
}
91
114
92
115
/**
116
+ * Test add styles
117
+ *
93
118
* @covers ::addParagraphStyle
94
119
* @covers ::addFontStyle
95
120
* @covers ::addTableStyle
@@ -114,6 +139,8 @@ public function testAddStyles()
114
139
}
115
140
116
141
/**
142
+ * Test add title style
143
+ *
117
144
* @covers ::addTitleStyle
118
145
*/
119
146
public function testAddTitleStyle ()
@@ -126,6 +153,8 @@ public function testAddTitleStyle()
126
153
}
127
154
128
155
/**
156
+ * Test load template
157
+ *
129
158
* @covers ::loadTemplate
130
159
*/
131
160
public function testLoadTemplate ()
@@ -140,14 +169,16 @@ public function testLoadTemplate()
140
169
}
141
170
142
171
/**
143
- * @covers ::loadTemplate
172
+ * Test load template exception
173
+ *
174
+ * @covers ::loadTemplate
144
175
* @expectedException \PhpOffice\PhpWord\Exceptions\Exception
145
176
*/
146
177
public function testLoadTemplateException ()
147
178
{
148
179
$ templateFqfn = \join (
149
180
\DIRECTORY_SEPARATOR ,
150
- array (\PHPWORD_TESTS_BASE_DIR , 'PhpWord ' , 'Tests ' , 'data ' , 'templates ' , 'blanks.docx ' )
181
+ array (\PHPWORD_TESTS_BASE_DIR , 'PhpWord ' , 'Tests ' , '_files ' , 'templates ' , 'blanks.docx ' )
151
182
);
152
183
$ phpWord = new PhpWord ();
153
184
$ phpWord ->loadTemplate ($ templateFqfn );
0 commit comments