File tree Expand file tree Collapse file tree
test/classes/Plugins/Export Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1749217492 <code><![CDATA[$GLOBALS['plugin_param']['single_table']]]></code>
1749317493 </PossiblyInvalidArrayOffset>
1749417494 </file>
17495- <file src="test/classes/Plugins/Export/ExportOdsTest.php">
17496- <InternalMethod>
17497- <code>setOutputCallback</code>
17498- </InternalMethod>
17499- </file>
1750017495 <file src="test/classes/Plugins/Export/ExportOdtTest.php">
17501- <InternalMethod>
17502- <code>setOutputCallback</code>
17503- </InternalMethod>
1750417496 <InvalidArrayOffset>
1750517497 <code><![CDATA[$GLOBALS['foo_columns']]]></code>
1750617498 </InvalidArrayOffset>
Original file line number Diff line number Diff line change 2323use ReflectionProperty ;
2424use stdClass ;
2525
26+ use function bin2hex ;
27+
2628use const MYSQLI_BLOB_FLAG ;
2729use const MYSQLI_TYPE_DATE ;
2830use const MYSQLI_TYPE_DATETIME ;
@@ -177,20 +179,12 @@ public function testExportHeader(): void
177179 public function testExportFooter (): void
178180 {
179181 $ GLOBALS ['ods_buffer ' ] = 'header ' ;
180-
181- $ this ->expectOutputRegex ('/^504b.*636f6e74656e742e786d6c/ ' );
182- $ this ->setOutputCallback ('bin2hex ' );
183-
184- $ this ->assertTrue (
185- $ this ->object ->exportFooter ()
186- );
187-
182+ $ this ->assertTrue ($ this ->object ->exportFooter ());
183+ $ output = $ this ->getActualOutputForAssertion ();
184+ $ this ->assertMatchesRegularExpression ('/^504b.*636f6e74656e742e786d6c/ ' , bin2hex ($ output ));
188185 $ this ->assertStringContainsString ('header ' , $ GLOBALS ['ods_buffer ' ]);
189-
190186 $ this ->assertStringContainsString ('</office:spreadsheet> ' , $ GLOBALS ['ods_buffer ' ]);
191-
192187 $ this ->assertStringContainsString ('</office:body> ' , $ GLOBALS ['ods_buffer ' ]);
193-
194188 $ this ->assertStringContainsString ('</office:document-content> ' , $ GLOBALS ['ods_buffer ' ]);
195189 }
196190
Original file line number Diff line number Diff line change 2525use stdClass ;
2626
2727use function __ ;
28+ use function bin2hex ;
2829
2930use const MYSQLI_BLOB_FLAG ;
3031use const MYSQLI_NUM_FLAG ;
@@ -313,16 +314,10 @@ public function testExportHeader(): void
313314 public function testExportFooter (): void
314315 {
315316 $ GLOBALS ['odt_buffer ' ] = 'header ' ;
316-
317- $ this ->expectOutputRegex ('/^504b.*636f6e74656e742e786d6c/ ' );
318- $ this ->setOutputCallback ('bin2hex ' );
319-
320- $ this ->assertTrue (
321- $ this ->object ->exportFooter ()
322- );
323-
317+ $ this ->assertTrue ($ this ->object ->exportFooter ());
318+ $ output = $ this ->getActualOutputForAssertion ();
319+ $ this ->assertMatchesRegularExpression ('/^504b.*636f6e74656e742e786d6c/ ' , bin2hex ($ output ));
324320 $ this ->assertStringContainsString ('header ' , $ GLOBALS ['odt_buffer ' ]);
325-
326321 $ this ->assertStringContainsString (
327322 '</office:text></office:body></office:document-content> ' ,
328323 $ GLOBALS ['odt_buffer ' ]
You can’t perform that action at this time.
0 commit comments