Completed
Push — master ( 037cc5...776a32 )
by Guillermo A.
09:42
created

AccountTest::testFindAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GuillermoandraeTest\Highrise\Repositories;
4
5
use Guillermoandrae\Highrise\Repositories\AccountRepository;
6
use GuillermoandraeTest\Highrise\TestCase;
7
8
class AccountTest extends TestCase
9
{
10
    /**
11
     * @var AccountRepository
12
     */
13
    private $resource;
14
15
    public function testShow()
16
    {
17
        $account = $this->resource->show();
18
        $this->assertSame('Your Company', $account->getName());
0 ignored issues
show
Bug introduced by
The method getName() does not exist on Guillermoandrae\Highrise\Models\ModelInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to Guillermoandrae\Highrise\Models\ModelInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        $this->assertSame('Your Company', $account->/** @scrutinizer ignore-call */ getName());
Loading history...
19
    }
20
21
    public function testFind()
22
    {
23
        $this->expectExceptionMessage('The findById method of this repository is not supported');
24
        $this->resource->find('test');
25
    }
26
27
    public function testFindAll()
28
    {
29
        $this->expectExceptionMessage('The findAll method of this repository is not supported');
30
        $this->resource->findAll();
31
    }
32
33
    public function testSearch()
34
    {
35
        $this->expectExceptionMessage('The search method of this repository is not supported');
36
        $this->resource->search();
37
    }
38
39
    protected function setUp()
40
    {
41
        $client = $this->getMockClient(
42
            200,
43
            [],
44
            $this->getMockModel('account')
45
        );
46
        $this->resource = new AccountRepository($this->getAdapter($client));
47
    }
48
}
49