Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function testVerification() : void |
||
17 | { |
||
18 | /* @var $package PackageInterface|\PHPUnit_Framework_MockObject_MockObject */ |
||
19 | $package = $this->createMock(PackageInterface::class); |
||
20 | $packageName = uniqid('packageName', true); |
||
21 | |||
22 | $package->expects(self::any())->method('getName')->willReturn($packageName); |
||
23 | |||
24 | $verification = UnknownPackageFormat::fromNonGitPackage($package); |
||
25 | |||
26 | self::assertInstanceOf(UnknownPackageFormat::class, $verification); |
||
27 | self::assertSame($packageName, $verification->packageName()); |
||
28 | self::assertFalse($verification->isVerified(), 'Unknown package types cannot be verified'); |
||
29 | self::assertSame( |
||
30 | 'Package "' |
||
31 | . $packageName |
||
32 | . '" is in a format that Roave\ComposerGpgVerify cannot verify:' |
||
33 | . ' try forcing it to be downloaded as GIT repository', |
||
34 | $verification->printReason() |
||
35 | ); |
||
36 | } |
||
37 | } |
||
38 |