Completed
Push — master ( b252cf...4e9779 )
by Robbie
10s
created

UpdatePackageInfoTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 28
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B testGetPackageInfo() 0 25 1
1
<?php
2
3
namespace BringYourOwnIdeas\Maintenance\Tests\Tasks;
4
5
use BringYourOwnIdeas\Maintenance\Util\ComposerLoader;
6
use SapphireTest;
7
use BringYourOwnIdeas\Maintenance\Tasks\UpdatePackageInfo;
8
9
class UpdatePackageInfoTest extends SapphireTest
10
{
11
    public function testGetPackageInfo()
12
    {
13
        $loader = $this->getMockBuilder(ComposerLoader::class)->setMethods(['getLock'])->getMock();
0 ignored issues
show
Bug introduced by
The method getMockBuilder() does not seem to exist on object<BringYourOwnIdeas...\UpdatePackageInfoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
        $loader->method('getLock')->willReturn(json_decode(<<<LOCK
15
{
16
    "packages": [
17
        {
18
            "name": "fake/package",
19
            "description": "A faux package from a mocked composer.lock for testing purposes",
20
            "version": "1.0.0"
21
        }
22
    ]
23
}
24
LOCK
25
        ));
26
        $processor = new UpdatePackageInfo;
27
        $output = $processor->getPackageInfo($loader->getLock()->packages);
28
        $this->assertInternalType('array', $output);
0 ignored issues
show
Bug introduced by
The method assertInternalType() does not seem to exist on object<BringYourOwnIdeas...\UpdatePackageInfoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
        $this->assertCount(1, $output);
0 ignored issues
show
Bug introduced by
The method assertCount() does not seem to exist on object<BringYourOwnIdeas...\UpdatePackageInfoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
        $this->assertSame([
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<BringYourOwnIdeas...\UpdatePackageInfoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
            "Name" => "fake/package",
32
            "Description" => "A faux package from a mocked composer.lock for testing purposes",
33
            "Version" => "1.0.0"
34
        ], $output[0]);
35
    }
36
}
37