GraphAware\Reco4PHP\Tests\Integration\SimpleFriendsRecoEngineTest::testRecoForJohn PHP Метод

testRecoForJohn() публичный Метод

public testRecoForJohn ( )
    public function testRecoForJohn()
    {
        $engine = $this->recoService->getRecommender('find_friends');
        $john = $this->getUserNode('John');
        $recommendations = $engine->recommend($john, new SimpleContext());
        $recommendations->sort();
        $this->assertEquals(2, $recommendations->size());
        $this->assertNull($recommendations->getItemBy('name', 'John'));
        $recoForMarc = $recommendations->getItemBy('name', 'marc');
        $this->assertEquals(1, $recoForMarc->totalScore());
        $recoForBill = $recommendations->getItemBy('name', 'Bill');
        $this->assertEquals(2, $recoForBill->totalScore());
    }