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

BotTest::testIsEditionRestricted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 8
rs 10
c 1
b 0
f 0
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