32
32
* Test class for AbstractWriter.
33
33
*
34
34
* @coversDefaultClass \AbstractWriter
35
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
35
36
*/
36
37
class AbstractWriterTest extends TestCase
37
38
{
@@ -40,28 +41,33 @@ class AbstractWriterTest extends TestCase
40
41
*/
41
42
public function testConstruct (): void
42
43
{
43
- /** @var AbstractWriter $oStubWriter */
44
44
if (method_exists ($ this , 'getMockForAbstractClass ' )) {
45
+ /** @var AbstractWriter $oStubWriter */
45
46
$ oStubWriter = $ this ->getMockForAbstractClass (AbstractWriter::class);
46
47
} else {
48
+ /** @var AbstractWriter $oStubWriter */
47
49
$ oStubWriter = new class () extends AbstractWriter {
48
50
};
49
51
}
50
- /** @var ZipInterface $oStubZip */
51
52
if (method_exists ($ this , 'getMockForAbstractClass ' )) {
53
+ /** @var ZipInterface $oStubZip */
52
54
$ oStubZip = $ this ->getMockForAbstractClass (ZipInterface::class);
53
55
} else {
56
+ /** @var ZipInterface $oStubZip */
54
57
$ oStubZip = new class () implements ZipInterface {
55
- public function open ($ filename ): void
58
+ public function open ($ filename )
56
59
{
60
+ return $ this ;
57
61
}
58
62
59
- public function close (): void
63
+ public function close ()
60
64
{
65
+ return $ this ;
61
66
}
62
67
63
- public function addFromString (string $ localname , string $ contents , bool $ withCompression = true ): void
68
+ public function addFromString (string $ localname , string $ contents , bool $ withCompression = true )
64
69
{
70
+ return $ this ;
65
71
}
66
72
};
67
73
}
@@ -85,10 +91,11 @@ public function testAllDrawingsIncludesMasterSlides(): void
85
91
$ masterSlide = $ masterSlides [0 ];
86
92
$ masterSlide ->createDrawingShape ();
87
93
88
- /** @var TestAbstractWriter $writer */
89
94
if (method_exists ($ this , 'getMockForAbstractClass ' )) {
95
+ /** @var TestAbstractWriter $writer */
90
96
$ writer = $ this ->getMockForAbstractClass (TestAbstractWriter::class);
91
97
} else {
98
+ /** @var TestAbstractWriter $writer */
92
99
$ writer = new class () extends TestAbstractWriter {
93
100
};
94
101
}
0 commit comments