Passed
Push — master ( 2f8437...bbe808 )
by Radosław
02:25
created

SearchProviderTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testReturnsCollection() 0 15 1
1
<?php
2
3
namespace Radowoj\Searcher\SearchProvider;
4
5
use PHPUnit\Framework\TestCase;
6
use Radowoj\Searcher\SearchProvider\SearchProvider;
7
use Radowoj\Searcher\SearchResult\Collection;
8
use Radowoj\Searcher\SearchResult\ICollection;
9
use stdClass;
10
11
class SearchProviderTest extends TestCase
12
{
13
    public function testReturnsCollection()
14
    {
15
        $mock = $this->getMockForAbstractClass(SearchProvider::class);
16
17
        $mock->expects($this->once())
18
            ->method('searchRequest')
19
            ->will($this->returnValue(new stdClass));
20
21
        $mock->expects($this->once())
22
            ->method('getCollection')
23
            ->will($this->returnValue(new Collection));
24
25
        $result = $mock->search('foo');
26
        $this->assertInstanceOf(ICollection::class, $result);
27
    }
28
}
29