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

SearchProviderTest::testReturnsCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

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