diff --git a/lib/ImportExport/AbstractImportExport.php b/lib/ImportExport/AbstractImportExport.php index 54452301..3a234438 100644 --- a/lib/ImportExport/AbstractImportExport.php +++ b/lib/ImportExport/AbstractImportExport.php @@ -141,7 +141,7 @@ abstract class AbstractImportExport { return true; } - abstract public function parse(string $data, bool $flat): array; + abstract protected function parse(string $data, bool $flat): array; abstract public function export(string $user, bool $flat = false): string; diff --git a/lib/ImportExport/OPML.php b/lib/ImportExport/OPML.php index 92252696..aa311f8a 100644 --- a/lib/ImportExport/OPML.php +++ b/lib/ImportExport/OPML.php @@ -10,7 +10,7 @@ use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\User\Exception as UserException; class OPML extends AbstractImportExport { - public function parse(string $opml, bool $flat): array { + protected function parse(string $opml, bool $flat): array { $d = new \DOMDocument; if (!@$d->loadXML($opml)) { // not a valid XML document diff --git a/tests/cases/ImportExport/TestOPML.php b/tests/cases/ImportExport/TestOPML.php index 0002f2c8..e4ef7b42 100644 --- a/tests/cases/ImportExport/TestOPML.php +++ b/tests/cases/ImportExport/TestOPML.php @@ -109,7 +109,8 @@ OPML_EXPORT_SERIALIZATION; /** @dataProvider provideParserData */ public function testParseOpmlForImport(string $file, bool $flat, $exp) { $data = file_get_contents(\JKingWeb\Arsse\DOCROOT."Import/OPML/$file"); - $parser = new OPML; + // set up a partial mock to make the ImportExport::parse() method visible + $parser = \Phake::makeVisible(\Phake::partialMock(OPML::class)); if ($exp instanceof \JKingWeb\Arsse\AbstractException) { $this->assertException($exp); $parser->parse($data, $flat);