Passed
Push — master ( 9975a0...1b82ab )
by Jeroen
02:06
created

testResultsGetMappedToTheCorrectModels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Eloquent\Collection;
6
use PHPUnit\Framework\TestCase;
7
use ScoutEngines\Solr\SolrEngine;
8
use Solarium\Client;
9
use Solarium\QueryType\Update\Query\Query;
10
11
class SolrEngineTest extends TestCase
12
{
13
    public function testUpdateAddsModelsToTheIndex()
14
    {
15
        $solrClient = $this->getMockBuilder(Client::class)
16
            ->setMethods(['update'])
17
            ->getMock();
18
19
        $query = new Query();
20
21
        $solrClient->expects($this->once())
22
            ->method('update')
23
            ->with($this->equalTo($query));
24
25
        $engine = new SolrEngine($solrClient);
26
27
        $engine->update(Collection::make([new SolrEngineTestModel]));
28
    }
29
30
    public function testDeleteRemovesUpdatesFromTheIndex()
31
    {
32
33
    }
34
35
    public function testSearchSendsCorrectConditionsToSolr()
36
    {
37
38
    }
39
40
    public function testResultsGetMappedToTheCorrectModels()
41
    {
42
43
    }
44
}