Completed
Push — master ( 255cb9...0ed13c )
by Marco
05:38
created
test/RoaveTest/ComposerGpgVerify/VerifyTest.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace RoaveTest\ComposerGpgVerify;
6 6
 
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
             ->installationManager
113 113
             ->expects(self::any())
114 114
             ->method('getInstallPath')
115
-            ->willReturnCallback(function (PackageInterface $package) : string {
115
+            ->willReturnCallback(function(PackageInterface $package) : string {
116 116
                 return array_search($package, $this->installedPackages, true);
117 117
             });
118 118
         $this
119 119
             ->localRepository
120 120
             ->expects(self::any())
121 121
             ->method('getPackages')
122
-            ->willReturnCallback(function () {
122
+            ->willReturnCallback(function() {
123 123
                 return array_values($this->installedPackages);
124 124
             });
125 125
     }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     public function testWillRejectNonGitPackages() : void
165 165
     {
166 166
         $packageName = 'vendor1/package1';
167
-        $vendor1     = sys_get_temp_dir() . '/' . uniqid('vendor', true) . '/' . $packageName;
167
+        $vendor1     = sys_get_temp_dir().'/'.uniqid('vendor', true).'/'.$packageName;
168 168
 
169 169
         /* @var $package PackageInterface|\PHPUnit_Framework_MockObject_MockObject */
170 170
         $package = $this->createMock(PackageInterface::class);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
         $this->configureCorrectComposerSetup();
195 195
 
196
-        putenv('GNUPGHOME=' . $gpgHomeDirectory);
196
+        putenv('GNUPGHOME='.$gpgHomeDirectory);
197 197
 
198 198
         $this->assertWillSucceedPackageVerification();
199 199
     }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
         $this->configureCorrectComposerSetup();
219 219
 
220
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
220
+        putenv('GNUPGHOME='.$personalGpgDirectory);
221 221
 
222 222
         $this->assertWillFailPackageVerification();
223 223
     }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         $this->configureCorrectComposerSetup();
244 244
 
245
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
245
+        putenv('GNUPGHOME='.$personalGpgDirectory);
246 246
         putenv('LANGUAGE=de_DE');
247 247
 
248 248
         try {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
         $this->configureCorrectComposerSetup();
277 277
 
278
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
278
+        putenv('GNUPGHOME='.$personalGpgDirectory);
279 279
 
280 280
         $this->assertWillSucceedPackageVerification();
281 281
     }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
         $this->configureCorrectComposerSetup();
301 301
 
302
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
302
+        putenv('GNUPGHOME='.$personalGpgDirectory);
303 303
 
304 304
         $this->assertWillFailPackageVerification();
305 305
     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
         $this->configureCorrectComposerSetup();
325 325
 
326
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
326
+        putenv('GNUPGHOME='.$personalGpgDirectory);
327 327
 
328 328
         $this->assertWillSucceedPackageVerification();
329 329
     }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 
343 343
         $this->configureCorrectComposerSetup();
344 344
 
345
-        putenv('GNUPGHOME=' . $gpgHomeDirectory);
345
+        putenv('GNUPGHOME='.$gpgHomeDirectory);
346 346
 
347 347
         $this->assertWillSucceedPackageVerification();
348 348
     }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
         $this->configureCorrectComposerSetup();
362 362
 
363
-        putenv('GNUPGHOME=' . $this->makeGpgHomeDirectory());
363
+        putenv('GNUPGHOME='.$this->makeGpgHomeDirectory());
364 364
 
365 365
         $this->assertWillFailPackageVerification();
366 366
     }
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 
383 383
         $this->configureCorrectComposerSetup();
384 384
 
385
-        putenv('GNUPGHOME=' . $this->makeGpgHomeDirectory());
385
+        putenv('GNUPGHOME='.$this->makeGpgHomeDirectory());
386 386
 
387 387
         $this->assertWillFailPackageVerification();
388 388
     }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 
402 402
         $this->configureCorrectComposerSetup();
403 403
 
404
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
404
+        putenv('GNUPGHOME='.$personalGpgDirectory);
405 405
 
406 406
         $this->assertWillFailPackageVerification();
407 407
     }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 
424 424
         $this->configureCorrectComposerSetup();
425 425
 
426
-        putenv('GNUPGHOME=' . $gpgHome);
426
+        putenv('GNUPGHOME='.$gpgHome);
427 427
 
428 428
         $this->assertWillFailPackageVerification();
429 429
     }
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 
446 446
         $this->configureCorrectComposerSetup();
447 447
 
448
-        putenv('GNUPGHOME=' . $gpgHome);
448
+        putenv('GNUPGHOME='.$gpgHome);
449 449
 
450 450
         $this->assertWillFailPackageVerification();
451 451
     }
@@ -465,14 +465,14 @@  discard block
 block discarded – undo
465 465
 
466 466
         $this->configureCorrectComposerSetup();
467 467
 
468
-        putenv('GNUPGHOME=' . $personalGpgDirectory);
468
+        putenv('GNUPGHOME='.$personalGpgDirectory);
469 469
 
470 470
         $this->assertWillFailPackageVerification();
471 471
     }
472 472
 
473 473
     private function makeVendorDirectory() : string
474 474
     {
475
-        $vendorDirectory = sys_get_temp_dir() . '/' . uniqid('vendor', true);
475
+        $vendorDirectory = sys_get_temp_dir().'/'.uniqid('vendor', true);
476 476
 
477 477
         self::assertTrue(mkdir($vendorDirectory));
478 478
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
         string $email,
526 526
         string $name
527 527
     ) : string {
528
-        $dependencyRepository = $vendorDirectory . '/' . $packageName;
528
+        $dependencyRepository = $vendorDirectory.'/'.$packageName;
529 529
 
530 530
         self::assertTrue(mkdir($dependencyRepository, 0777, true));
531 531
 
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 
554 554
     private function makeGpgHomeDirectory() : string
555 555
     {
556
-        $homeDirectory = sys_get_temp_dir() . '/' . uniqid('gpg-verification-test', true);
556
+        $homeDirectory = sys_get_temp_dir().'/'.uniqid('gpg-verification-test', true);
557 557
 
558 558
         self::assertTrue(mkdir($homeDirectory, 0700));
559 559
 
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
         self::assertGreaterThan(
579 579
             0,
580 580
             file_put_contents(
581
-                $gpgHomeDirectory . '/key-info.txt',
581
+                $gpgHomeDirectory.'/key-info.txt',
582 582
                 str_replace(['<<<NAME>>>', '<<<EMAIL>>>'], [$name, $emailAddress], $input)
583 583
             )
584 584
         );
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         string $foreignKey,
643 643
         bool $sign
644 644
     ) : void {
645
-        $exportPath = sys_get_temp_dir() . '/' . uniqid('exportedKey', true);
645
+        $exportPath = sys_get_temp_dir().'/'.uniqid('exportedKey', true);
646 646
 
647 647
         (new Process(
648 648
             sprintf('gpg --export --armor > %s', escapeshellarg($exportPath)),
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
             ->setTimeout(30)
663 663
             ->mustRun();
664 664
 
665
-        if (! $sign) {
665
+        if (!$sign) {
666 666
             return;
667 667
         }
668 668
 
Please login to merge, or discard this patch.