Total Complexity | 4 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class SupportedAddonsLoaderTest extends SapphireTest |
||
9 | { |
||
10 | /** |
||
11 | * @var SupportedAddonsLoader |
||
12 | */ |
||
13 | protected $loader; |
||
14 | |||
15 | protected function setUp() |
||
16 | { |
||
17 | parent::setUp(); |
||
18 | |||
19 | $this->loader = $this->getMockBuilder(SupportedAddonsLoader::class) |
||
|
|||
20 | ->setMethods(['doRequest']) |
||
21 | ->getMock(); |
||
22 | } |
||
23 | |||
24 | public function testCallsSupportedAddonsEndpoint() |
||
25 | { |
||
26 | $this->loader->expects($this->once()) |
||
27 | ->method('doRequest') |
||
28 | ->with('addons.silverstripe.org/api/supported-addons', function () { |
||
29 | // no-op |
||
30 | }); |
||
31 | |||
32 | $this->loader->getAddonNames(); |
||
33 | } |
||
34 | |||
35 | public function testCallbackReturnsAddonsFromBody() |
||
49 | } |
||
50 | |||
51 | public function testValueOfDoRequestIsReturned() |
||
58 | } |
||
59 | } |
||
60 |
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..