Passed
Push — master ( 4a3e7e...eed543 )
by Guillermo A.
01:38
created

ReadOnlyResourceTraitTest::testDelete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GuillermoandraeTest\Highrise\Resources;
4
5
use Guillermoandrae\Highrise\Resources\ReadOnlyResourceTrait;
6
use GuillermoandraeTest\Highrise\TestCase;
7
8
class ReadOnlyResourceTraitTest extends TestCase
9
{
10
    /**
11
     * @var ReadOnlyResourceTrait
12
     */
13
    private $resource;
14
15
    public function testCreate()
16
    {
17
        $this->expectExceptionMessage('The create method of this resource is not supported');
18
        $this->resource->create([]);
19
    }
20
21
    public function testUpdate()
22
    {
23
        $this->expectExceptionMessage('The update method of this resource is not supported');
24
        $this->resource->update('test', []);
25
    }
26
27
    public function testDelete()
28
    {
29
        $this->expectExceptionMessage('The delete method of this resource is not supported');
30
        $this->resource->delete('test');
31
    }
32
33
    protected function setUp()
34
    {
35
        $this->resource = $this->getMockForTrait(ReadOnlyResourceTrait::class);
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockForTrait(G...lyResourceTrait::class) of type PHPUnit\Framework\MockObject\MockObject is incompatible with the declared type Guillermoandrae\Highrise...s\ReadOnlyResourceTrait of property $resource.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
36
    }
37
}
38