assertEquals($expected, $result); } public function providerDiffByType(): array { return [ [ 'htmldiff', $this->loadAndParseFile(__DIR__ . '/fixtures/page1.wiki'), $this->loadAndParseFile(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/htmldiff.html'), ], [ 'sidediff', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/sidediff.html'), ], [ 'sidediff-char', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/sidediff-char.html'), ], [ 'inlinediff', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/inlinediff.html'), ], [ 'inlinediff-char', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/inlinediff-char.html'), ], [ 'sidediff-full', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/sidediff-full.html'), ], [ 'sidediff-full-char', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/sidediff-full-char.html'), ], [ 'inlinediff-full', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/inlinediff-full.html'), ], [ 'inlinediff-full-char', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), file_get_contents(__DIR__ . '/fixtures/inlinediff-full-char.html'), ], [ 'unidiff', file_get_contents(__DIR__ . '/fixtures/page1.wiki'), file_get_contents(__DIR__ . '/fixtures/page2.wiki'), include __DIR__ . '/fixtures/unidiff.php', ], ]; } protected function loadAndParseFile($file) { $parserLib = TikiLib::lib('parser'); $data = file_get_contents($file); $parse_options = ['is_html' => false, 'noheadinc' => true, 'suppress_icons' => true, 'noparseplugins' => true]; return $parserLib->parse_data($data, $parse_options); } }