@@ -357,9 +357,9 @@ public function testReadDrawing(): void
357
357
}
358
358
359
359
/**
360
- * Test reading FormField - DROPDOWN
360
+ * Test reading FormField - DROPDOWN.
361
361
*/
362
- public function testReadFormFieldDropdown ()
362
+ public function testReadFormFieldDropdown (): void
363
363
{
364
364
$ documentXml = '<w:p>
365
365
<w:r>
@@ -404,28 +404,28 @@ public function testReadFormFieldDropdown()
404
404
</w:r>
405
405
</w:p> ' ;
406
406
407
- $ phpWord = $ this ->getDocumentFromString (array ( 'document ' => $ documentXml) );
407
+ $ phpWord = $ this ->getDocumentFromString ([ 'document ' => $ documentXml] );
408
408
409
409
$ elements = $ phpWord ->getSection (0 )->getElements ();
410
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\TextRun ' , $ elements [0 ]);
410
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\TextRun ' , $ elements [0 ]);
411
411
412
412
$ subElements = $ elements [0 ]->getElements ();
413
413
414
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\Text ' , $ subElements [0 ]);
415
- $ this -> assertEquals ('Reference ' , $ subElements [0 ]->getText ());
414
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\Text ' , $ subElements [0 ]);
415
+ self :: assertEquals ('Reference ' , $ subElements [0 ]->getText ());
416
416
417
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\FormField ' , $ subElements [1 ]);
418
- $ this -> assertEquals ('dropdown ' , $ subElements [1 ]->getType ());
419
- $ this -> assertEquals ('DropDownList1 ' , $ subElements [1 ]->getName ());
420
- $ this -> assertEquals ('2 ' , $ subElements [1 ]->getValue ());
421
- $ this -> assertEquals ('Option Two ' , $ subElements [1 ]->getText ());
422
- $ this -> assertEquals (array ( 'TBD ' , 'Option One ' , 'Option Two ' , 'Option Three ' , 'Other ' ) , $ subElements [1 ]->getEntries ());
417
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\FormField ' , $ subElements [1 ]);
418
+ self :: assertEquals ('dropdown ' , $ subElements [1 ]->getType ());
419
+ self :: assertEquals ('DropDownList1 ' , $ subElements [1 ]->getName ());
420
+ self :: assertEquals ('2 ' , $ subElements [1 ]->getValue ());
421
+ self :: assertEquals ('Option Two ' , $ subElements [1 ]->getText ());
422
+ self :: assertEquals ([ 'TBD ' , 'Option One ' , 'Option Two ' , 'Option Three ' , 'Other ' ] , $ subElements [1 ]->getEntries ());
423
423
}
424
424
425
425
/**
426
- * Test reading FormField - textinput
426
+ * Test reading FormField - textinput.
427
427
*/
428
- public function testReadFormFieldTextinput ()
428
+ public function testReadFormFieldTextinput (): void
429
429
{
430
430
$ documentXml = '<w:p>
431
431
<w:r>
@@ -473,27 +473,27 @@ public function testReadFormFieldTextinput()
473
473
</w:r>
474
474
</w:p> ' ;
475
475
476
- $ phpWord = $ this ->getDocumentFromString (array ( 'document ' => $ documentXml) );
476
+ $ phpWord = $ this ->getDocumentFromString ([ 'document ' => $ documentXml] );
477
477
478
478
$ elements = $ phpWord ->getSection (0 )->getElements ();
479
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\TextRun ' , $ elements [0 ]);
479
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\TextRun ' , $ elements [0 ]);
480
480
481
481
$ subElements = $ elements [0 ]->getElements ();
482
482
483
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\Text ' , $ subElements [0 ]);
484
- $ this -> assertEquals ('Fieldname ' , $ subElements [0 ]->getText ());
483
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\Text ' , $ subElements [0 ]);
484
+ self :: assertEquals ('Fieldname ' , $ subElements [0 ]->getText ());
485
485
486
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\FormField ' , $ subElements [1 ]);
487
- $ this -> assertEquals ('textinput ' , $ subElements [1 ]->getType ());
488
- $ this -> assertEquals ('TextInput2 ' , $ subElements [1 ]->getName ());
489
- $ this -> assertEquals ('This is some sample text ' , $ subElements [1 ]->getValue ());
490
- $ this -> assertEquals ('This is some sample text ' , $ subElements [1 ]->getText ());
486
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\FormField ' , $ subElements [1 ]);
487
+ self :: assertEquals ('textinput ' , $ subElements [1 ]->getType ());
488
+ self :: assertEquals ('TextInput2 ' , $ subElements [1 ]->getName ());
489
+ self :: assertEquals ('This is some sample text ' , $ subElements [1 ]->getValue ());
490
+ self :: assertEquals ('This is some sample text ' , $ subElements [1 ]->getText ());
491
491
}
492
492
493
493
/**
494
- * Test reading FormField - checkbox
494
+ * Test reading FormField - checkbox.
495
495
*/
496
- public function testReadFormFieldCheckbox ()
496
+ public function testReadFormFieldCheckbox (): void
497
497
{
498
498
$ documentXml = '<w:p>
499
499
<w:pPr/>
@@ -529,18 +529,18 @@ public function testReadFormFieldCheckbox()
529
529
</w:r>
530
530
</w:p> ' ;
531
531
532
- $ phpWord = $ this ->getDocumentFromString (array ( 'document ' => $ documentXml) );
532
+ $ phpWord = $ this ->getDocumentFromString ([ 'document ' => $ documentXml] );
533
533
534
534
$ elements = $ phpWord ->getSection (0 )->getElements ();
535
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\TextRun ' , $ elements [0 ]);
535
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\TextRun ' , $ elements [0 ]);
536
536
537
537
$ subElements = $ elements [0 ]->getElements ();
538
538
539
539
// $this->assertInstanceOf('PhpOffice\PhpWord\Element\Text', $subElements[0]);
540
540
// $this->assertEquals('Fieldname', $subElements[0]->getText());
541
541
542
- $ this -> assertInstanceOf ('PhpOffice\PhpWord\Element\FormField ' , $ subElements [0 ]);
543
- $ this -> assertEquals ('checkbox ' , $ subElements [0 ]->getType ());
544
- $ this -> assertEquals ('SomeCheckbox ' , $ subElements [0 ]->getName ());
542
+ self :: assertInstanceOf ('PhpOffice\PhpWord\Element\FormField ' , $ subElements [0 ]);
543
+ self :: assertEquals ('checkbox ' , $ subElements [0 ]->getType ());
544
+ self :: assertEquals ('SomeCheckbox ' , $ subElements [0 ]->getName ());
545
545
}
546
546
}
0 commit comments