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

WordsListTest::testImportWords()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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