ManhattanTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 5
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace stojg\recommend\tests;
4
5
use stojg\recommend\strategy\Manhattan;
6
7
class ManhattanTest extends \PHPUnit_Framework_TestCase
8
{
9
    protected $set;
10
11
    public function setUp()
12
    {
13
        $data = file_get_contents(__DIR__.'/../fixtures/users.json');
14
        $this->set = json_decode($data, true);
15
    }
16
17
    public function testManhattanAngelicaBill()
18
    {
19
        $manhattan = new Manhattan();
20
        $score = $manhattan->run($this->set['Angelica'], $this->set['Bill']);
21
        $this->assertEquals(9.0, $score);
22
    }
23
}
24