| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class WikiBotConfigTest extends TestCase |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @dataProvider provideEditionRestricted |
||
| 19 | * |
||
| 20 | * @param $bool |
||
| 21 | * @param $text |
||
| 22 | * @param $botName |
||
| 23 | */ |
||
| 24 | public function testIsEditionRestricted($bool, $text, $botName = null) |
||
| 25 | { |
||
| 26 | $this::assertSame($bool, WikiBotConfig::isEditionRestricted($text, $botName)); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function provideEditionRestricted() |
||
| 30 | { |
||
| 31 | return [ |
||
| 32 | [false, 'bla bla'], |
||
| 33 | [true, '{{Protection|blabla}} bla'], |
||
| 34 | [true, '{{3R}} bla'], |
||
| 35 | [true, '{{nobots}} bla'], |
||
| 36 | [true, '{{bots|deny=Bob,FuBot}} bla', 'FuBot'], |
||
| 37 | [false, '{{bots|deny=Bob,FuBot}} bla'], |
||
| 38 | ]; |
||
| 41 |