8 use MediaWikiCoversValidator;
12 'http' => [
'foo.bar',
'http://foo.bar' ],
13 'https' => [
'foo.bar',
'http://foo.bar' ],
16 'invalid' => [
'purple kittens',
'purple kittens' ],
24 $reference =
new WikiReference( $canonicalServer,
'/wiki/$1' );
25 $this->
assertEquals( $expected, $reference->getDisplayName() );
29 $reference =
new WikiReference(
'https://acme.com',
'/wiki/$1',
'//acme.com' );
30 $this->
assertEquals(
'https://acme.com', $reference->getCanonicalServer() );
36 'https://acme.com/wiki/Foo',
44 'https://acme.com/wiki/Foo',
52 'https://acme.com/wiki/Foo#Bar',
59 'double fragment' => [
60 'https://acme.com/wiki/Foo#Bar%23Xus',
67 'escaped fragment' => [
68 'https://acme.com/wiki/Foo%23Bar',
76 'https://acme.com/Foo',
90 $expected, $canonicalServer, $server, $path, $page, $fragmentId
92 $reference =
new WikiReference( $canonicalServer, $path, $server );
93 $this->
assertEquals( $expected, $reference->getCanonicalUrl( $page, $fragmentId ) );
100 public function testGetUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId ) {
101 $reference =
new WikiReference( $canonicalServer, $path, $server );
102 $this->
assertEquals( $expected, $reference->getUrl( $page, $fragmentId ) );
108 '//acme.com/wiki/Foo',
115 'empty fragment' => [
116 '//acme.com/wiki/Foo',
124 '//acme.com/wiki/Foo#Bar',
131 'double fragment' => [
132 '//acme.com/wiki/Foo#Bar%23Xus',
139 'escaped fragment' => [
140 '//acme.com/wiki/Foo%23Bar',
161 public function testGetFullUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId ) {
162 $reference =
new WikiReference( $canonicalServer, $path, $server );
163 $this->
assertEquals( $expected, $reference->getFullUrl( $page, $fragmentId ) );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
testGetUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId)
provideGetCanonicalUrl
testGetFullUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId)
provideGetFullUrl
testGetCanonicalUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId)
provideGetCanonicalUrl
testGetDisplayName( $expected, $canonicalServer)
provideGetDisplayName
Reference to a locally-hosted wiki.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null