Passed
Push — master ( b85d4e...511693 )
by Dispositif
02:38
created

BotTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 11
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testIsEditionRestricted() 0 8 1
1
<?php
2
/**
3
 * This file is part of dispositif/wikibot application
4
 * 2019 © Philippe M. <[email protected]>
5
 * For the full copyright and MIT license information, please view the LICENSE file.
6
 */
7
8
declare(strict_types=1);
9
10
11
namespace App\Application\Tests;
12
13
use App\Application\Bot;
14
use PHPUnit\Framework\TestCase;
15
16
class BotTest extends TestCase
17
{
18
19
    public function testIsEditionRestricted()
20
    {
21
        $this::assertFalse(Bot::isEditionRestricted('bla bla'));
22
        $this::assertTrue(Bot::isEditionRestricted('{{Protection|blabla}} bla'));
23
        $this::assertTrue(Bot::isEditionRestricted('{{3R}} bla'));
24
        $this::assertTrue(Bot::isEditionRestricted('{{nobots}} bla'));
25
        $this::assertTrue(Bot::isEditionRestricted('{{bots|deny=Bob,FuBot}} bla', 'FuBot'));
26
        $this::assertFalse(Bot::isEditionRestricted('{{bots|deny=Bob,FuBot}} bla'));;
27
    }
28
}
29