ArticleTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCheckNoBadWords() 0 4 1
A testGetArticle() 0 4 1
A testCheckBadWords() 0 5 1
A testLoad() 0 4 1
1
<?php
2
3
use \Mystem\Article;
4
5
class ArticleTest extends \PHPUnit_Framework_TestCase {
6
7
    public function testLoad()
8
    {
9
        $article = new Article('На дворе смеркалось');
10
        $this->assertCount(3, $article->words);
11
    }
12
13
    public function testGetArticle()
14
    {
15
        $article = new Article('Ёжик в тумане');
16
        $this->assertTrue(is_string($article->getArticle()));
17
    }
18
19
    public function testCheckBadWords()
20
    {
21
        $article = new Article('Не те бляди, что денег ради…');
22
        $this->assertNotEmpty($article->checkBadWords());
23
        $this->assertNotEmpty($article->checkBadWords(true));
24
    }
25
26
    public function testCheckNoBadWords()
27
    {
28
        $article = new Article('Однажды лебедь, рак и щука…');
29
        $this->assertEmpty($article->checkBadWords());
30
    }
31
32
}