• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cweagans / composer-patches / 4110992433

pending completion
4110992433

push

github

Cameron Eagans
Add basic tests for commands

456 of 570 relevant lines covered (80.0%)

3.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Command/RelockCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace cweagans\Composer\Command;
6

7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9

10
class RelockCommand extends PatchesCommandBase
11
{
12
    protected function configure(): void
13
    {
14
        $this->setName('patches-relock');
×
15
        $this->setDescription('Find all patches defined in the project and re-write patches.lock.');
×
16
        $this->setAliases(['prl']);
×
17
    }
18

19
    protected function execute(InputInterface $input, OutputInterface $output): int
20
    {
21
        $plugin = $this->getPatchesPluginInstance();
×
22
        if (is_null($plugin)) {
×
23
            return 1;
×
24
        }
25

26
        if (file_exists($plugin->getLockFile()->getPath())) {
×
27
            unlink($plugin->getLockFile()->getPath());
×
28
        }
29
        $plugin->createNewPatchesLock();
×
30
        $output->write('  - <info>patches.lock</info> has been recreated successfully.', true);
×
31
        return 0;
×
32
    }
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc