MystemTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 23
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testStemm() 0 3 1
A testStemmNotFound() 0 4 1
A testStemmNotRecreated() 0 7 1
1
<?php
2
3
use \Mystem\Mystem;
4
5
class MystemTest extends \PHPUnit_Framework_TestCase {
6
7
    public function testStemm()
8
    {
9
        $this->assertTrue(is_array(Mystem::stemm('тест')));
10
    }
11
12
    /**
13
     * @expectedException \Exception
14
     */
15
    public function testStemmNotFound()
16
    {
17
        Mystem::$mystemPath = '/WrongPath/';
18
        Mystem::stemm('тест');
19
    }
20
21
    public function testStemmNotRecreated()
22
    {
23
        Mystem::stemm('самолетами');
24
        $tStart = microtime( true );
25
        Mystem::stemm('пароходами');
26
        $tDiff = microtime( true ) - $tStart;
27
        $this->assertLessThan( 0.006, $tDiff, 'Took too long' );
28
    }
29
30
}