Test Failed
Push — master ( 3feb07...e3c021 )
by Dan
10:26
created

WordsListTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 17
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testImportWords() 0 13 1
1
<?php
2
3
namespace SixtyNine\Cloud\Tests\Model;
4
5
use Monolog\Logger;
6
use Monolog\Handler\StreamHandler;
7
use SixtyNine\Cloud\Model\WordsList;
8
9
class WordsListTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function testImportWords()
12
    {
13
14
        $logger = new Logger('my_logger');
15
        $logger->pushHandler(new StreamHandler('/tmp/log.log', Logger::DEBUG));
16
17
        $list = new WordsList();
18
        $list->setLogger($logger);
0 ignored issues
show
Bug introduced by
The method setLogger() does not seem to exist on object<SixtyNine\Cloud\Model\WordsList>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
        $list->importWords(file_get_contents(__DIR__ . '/../fixtures/lorem.txt'));
20
21
        $this->assertEquals(100, $list->getWordsCount());
22
        $logger->info(sprintf('The list contains %s words', $list->getWordsCount()));
23
    }
24
25
}
26
27