1717
1818namespace PhpOffice \PhpWord \Element ;
1919
20- use PhpOffice \PhpWord \Exception \Exception ;
2120use PhpOffice \PhpWord \PhpWord ;
2221use PhpOffice \PhpWord \Style ;
2322
2423/**
25- * Test class for PhpOffice\PhpWord\Element\Section
26- *
24+ * @covers \ PhpOffice\PhpWord\Element\Section
25+ * @coversDefaultClass \PhpOffice\PhpWord\Element\Section
2726 * @runTestsInSeparateProcesses
2827 */
2928class SectionTest extends \PHPUnit_Framework_TestCase
3029{
3130 /**
32- * Get style
33- */
34- public function testGetStyle ()
35- {
36- $ oSection = new Section (0 );
37- $ this ->assertAttributeEquals ($ oSection ->getStyle (), 'style ' , $ oSection );
38- }
39-
40- /**
41- * Get elements
42- */
43- public function testGetElements ()
44- {
45- $ oSection = new Section (0 );
46- $ this ->assertAttributeEquals ($ oSection ->getElements (), 'elements ' , $ oSection );
47- }
48-
49- /**
50- * Get footer
51- */
52- public function testGetFooters ()
53- {
54- $ oSection = new Section (0 );
55- $ this ->assertAttributeEquals ($ oSection ->getFooters (), 'footers ' , $ oSection );
56- }
57-
58- /**
59- * Get headers
60- */
61- public function testGetHeaders ()
62- {
63- $ oSection = new Section (0 );
64- $ this ->assertAttributeEquals ($ oSection ->getHeaders (), 'headers ' , $ oSection );
65- }
66-
67- /**
68- * Set settings
31+ * @covers ::setStyle
6932 */
7033 public function testSetStyle ()
7134 {
@@ -76,13 +39,12 @@ public function testSetStyle()
7639 }
7740
7841 /**
79- * Add elements
42+ * @coversNothing
8043 */
8144 public function testAddElements ()
8245 {
8346 $ objectSource = __DIR__ . '/../_files/documents/reader.docx ' ;
8447 $ imageSource = __DIR__ . '/../_files/images/PhpWord.png ' ;
85- // $imageUrl = 'http://php.net//images/logos/php-med-trans-light.gif';
8648
8749 $ section = new Section (0 );
8850 $ section ->setPhpWord (new PhpWord ());
@@ -124,8 +86,7 @@ public function testAddElements()
12486 }
12587
12688 /**
127- * Test add object exception
128- *
89+ * @coversNothing
12990 * @expectedException \PhpOffice\PhpWord\Exception\InvalidObjectException
13091 */
13192 public function testAddObjectException ()
@@ -137,6 +98,8 @@ public function testAddObjectException()
13798
13899 /**
139100 * Add title with predefined style
101+ *
102+ * @coversNothing
140103 */
141104 public function testAddTitleWithStyle ()
142105 {
@@ -150,7 +113,9 @@ public function testAddTitleWithStyle()
150113 }
151114
152115 /**
153- * Add header footer
116+ * @covers ::addHeader
117+ * @covers ::addFooter
118+ * @covers ::hasDifferentFirstPage
154119 */
155120 public function testAddHeaderFooter ()
156121 {
@@ -165,7 +130,8 @@ public function testAddHeaderFooter()
165130 }
166131
167132 /**
168- * Add header has different first page
133+ * @covers ::addHeader
134+ * @covers ::hasDifferentFirstPage
169135 */
170136 public function testHasDifferentFirstPage ()
171137 {
@@ -176,9 +142,8 @@ public function testHasDifferentFirstPage()
176142 }
177143
178144 /**
179- * Add header exception
180- *
181- * @expectedException Exception
145+ * @covers ::addHeader
146+ * @expectedException \Exception
182147 * @expectedExceptionMessage Invalid header/footer type.
183148 */
184149 public function testAddHeaderException ()
0 commit comments