MediaWiki REL1_32
ConfirmLinkAuthenticationRequestTest.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Auth;
4
5use InvalidArgumentException;
6
12
13 protected function getInstance( array $args = [] ) {
15 }
16
21 public function testConstructorException() {
23 }
24
29 private function getLinkRequests() {
30 $reqs = [];
31
32 $mb = $this->getMockBuilder( AuthenticationRequest::class )
33 ->setMethods( [ 'getUniqueId' ] );
34 for ( $i = 1; $i <= 3; $i++ ) {
35 $req = $mb->getMockForAbstractClass();
36 $req->expects( $this->any() )->method( 'getUniqueId' )
37 ->will( $this->returnValue( "Request$i" ) );
38 $reqs[$req->getUniqueId()] = $req;
39 }
40
41 return $reqs;
42 }
43
44 public function provideLoadFromSubmission() {
45 $reqs = $this->getLinkRequests();
46
47 return [
48 'Empty request' => [
49 [],
50 [],
51 [ 'linkRequests' => $reqs ],
52 ],
53 'Some confirmed' => [
54 [],
55 [ 'confirmedLinkIDs' => [ 'Request1', 'Request3' ] ],
56 [ 'confirmedLinkIDs' => [ 'Request1', 'Request3' ], 'linkRequests' => $reqs ],
57 ],
58 ];
59 }
60
61 public function testGetUniqueId() {
63 $this->assertSame(
64 get_class( $req ) . ':Request1|Request2|Request3',
65 $req->getUniqueId()
66 );
67 }
68}
they could even be mouse clicks or menu items whatever suits your program You should also get your if any
Definition COPYING.txt:326
if( $line===false) $args
Definition cdb.php:64
AuthManager MediaWiki\Auth\ConfirmLinkAuthenticationRequest.
testConstructorException()
InvalidArgumentException $linkRequests must not be empty.
this hook is for auditing only $req
Definition hooks.txt:1018
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))