Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
21 / 21 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| MockSimilarEditorsClient | |
100.00% |
21 / 21 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| getEditor | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSimilarEditors | |
100.00% |
20 / 20 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\SimilarEditors; |
| 4 | |
| 5 | class MockSimilarEditorsClient implements Client { |
| 6 | |
| 7 | /** |
| 8 | * @inheritDoc |
| 9 | */ |
| 10 | public function getEditor( string $editor ) { |
| 11 | return null; |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * @inheritDoc |
| 16 | */ |
| 17 | public function getSimilarEditors( string $editor ) { |
| 18 | return [ |
| 19 | new Neighbor( |
| 20 | 'SomeUser1', |
| 21 | 100, |
| 22 | 0.2, |
| 23 | 0.4, |
| 24 | new TimeOverlap( 0.6, 'medium' ), |
| 25 | new TimeOverlap( 0.8, 'high' ), |
| 26 | [] |
| 27 | ), |
| 28 | new Neighbor( |
| 29 | 'SomeUser2', |
| 30 | 500, |
| 31 | 0.7, |
| 32 | 0.5, |
| 33 | new TimeOverlap( 0.3, 'low' ), |
| 34 | new TimeOverlap( 0.1, 'low' ), |
| 35 | [] |
| 36 | ), |
| 37 | ]; |
| 38 | } |
| 39 | } |