X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flogging%2FLogFormatterTestCase.php;h=fc2ab916cb3c70c1dda2ae02018279156e37d3cf;hp=883af712404788ada2675dad765a135f4b98d245;hb=6cfb2e3d7a2b96d5041312fcec88248bb46573d7;hpb=15f6eff90c305d405fe4331c8a8dc8caa842e5b3 diff --git a/tests/phpunit/includes/logging/LogFormatterTestCase.php b/tests/phpunit/includes/logging/LogFormatterTestCase.php index 883af71240..fc2ab916cb 100644 --- a/tests/phpunit/includes/logging/LogFormatterTestCase.php +++ b/tests/phpunit/includes/logging/LogFormatterTestCase.php @@ -1,4 +1,5 @@ formatParametersForApi() ), 'Api log params is equal to expected array' ); + + if ( isset( $extra['preload'] ) ) { + $this->assertArrayEquals( + $this->getLinkTargetsAsStrings( $extra['preload'] ), + $this->getLinkTargetsAsStrings( + $formatter->getPreloadTitles() + ) + ); + } + } + + private function getLinkTargetsAsStrings( array $linkTargets ) { + return array_map( function ( LinkTarget $t ) { + return $t->getInterwiki() . ':' . $t->getNamespace() . ':' + . $t->getDBkey() . '#' . $t->getFragment(); + }, $linkTargets ); } protected function isLegacy( $extra ) {