-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45ff673
commit 97b7119
Showing
7 changed files
with
413 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SonsOfPHP\Bard\Tests\Console\Command; | ||
|
||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\Attributes\UsesClass; | ||
use PHPUnit\Framework\TestCase; | ||
use SonsOfPHP\Bard\Console\Application; | ||
use SonsOfPHP\Bard\Console\Command\AbstractCommand; | ||
use SonsOfPHP\Bard\Console\Command\AddCommand; | ||
use SonsOfPHP\Bard\Console\Command\CopyCommand; | ||
use SonsOfPHP\Bard\Console\Command\InitCommand; | ||
use SonsOfPHP\Bard\Console\Command\InstallCommand; | ||
use SonsOfPHP\Bard\Console\Command\MergeCommand; | ||
use SonsOfPHP\Bard\Console\Command\PullCommand; | ||
use SonsOfPHP\Bard\Console\Command\PushCommand; | ||
use SonsOfPHP\Bard\Console\Command\ReleaseCommand; | ||
use SonsOfPHP\Bard\Console\Command\SplitCommand; | ||
use SonsOfPHP\Bard\Console\Command\UpdateCommand; | ||
use SonsOfPHP\Bard\JsonFile; | ||
use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
#[Group('bard')] | ||
#[CoversClass(CopyCommand::class)] | ||
#[UsesClass(Application::class)] | ||
#[UsesClass(AbstractCommand::class)] | ||
#[UsesClass(AddCommand::class)] | ||
#[UsesClass(InitCommand::class)] | ||
#[UsesClass(InstallCommand::class)] | ||
#[UsesClass(MergeCommand::class)] | ||
#[UsesClass(PullCommand::class)] | ||
#[UsesClass(PushCommand::class)] | ||
#[UsesClass(ReleaseCommand::class)] | ||
#[UsesClass(SplitCommand::class)] | ||
#[UsesClass(UpdateCommand::class)] | ||
#[UsesClass(JsonFile::class)] | ||
#[UsesClass(AddPackageWorker::class)] | ||
final class CopyCommandTest extends TestCase | ||
{ | ||
private Application $application; | ||
|
||
private CopyCommand $command; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->application = new Application(); | ||
$this->command = $this->application->get('copy'); | ||
} | ||
|
||
public function testItExecutesSuccessfully(): void | ||
{ | ||
$commandTester = new CommandTester($this->command); | ||
|
||
$commandTester->execute([ | ||
'source' => 'LICENSE', | ||
'--dry-run' => true, | ||
'-vvv' => true, | ||
]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
src/SonsOfPHP/Bard/Tests/Console/Command/MergeCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SonsOfPHP\Bard\Tests\Console\Command; | ||
|
||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\Attributes\UsesClass; | ||
use PHPUnit\Framework\TestCase; | ||
use SonsOfPHP\Bard\Console\Application; | ||
use SonsOfPHP\Bard\Console\Command\AbstractCommand; | ||
use SonsOfPHP\Bard\Console\Command\AddCommand; | ||
use SonsOfPHP\Bard\Console\Command\CopyCommand; | ||
use SonsOfPHP\Bard\Console\Command\InitCommand; | ||
use SonsOfPHP\Bard\Console\Command\InstallCommand; | ||
use SonsOfPHP\Bard\Console\Command\MergeCommand; | ||
use SonsOfPHP\Bard\Console\Command\PullCommand; | ||
use SonsOfPHP\Bard\Console\Command\PushCommand; | ||
use SonsOfPHP\Bard\Console\Command\ReleaseCommand; | ||
use SonsOfPHP\Bard\Console\Command\SplitCommand; | ||
use SonsOfPHP\Bard\Console\Command\UpdateCommand; | ||
use SonsOfPHP\Bard\JsonFile; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Package\Authors; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Package\BranchAlias; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Package\Funding; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Package\Support; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\ClearSection; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateAutoloadDevSection; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateAutoloadSection; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateProvideSection; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateReplaceSection; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateRequireDevSection; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateRequireSection; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
#[Group('bard')] | ||
#[CoversClass(MergeCommand::class)] | ||
#[UsesClass(Application::class)] | ||
#[UsesClass(AbstractCommand::class)] | ||
#[UsesClass(AddCommand::class)] | ||
#[UsesClass(CopyCommand::class)] | ||
#[UsesClass(InitCommand::class)] | ||
#[UsesClass(InstallCommand::class)] | ||
#[UsesClass(PullCommand::class)] | ||
#[UsesClass(PushCommand::class)] | ||
#[UsesClass(ReleaseCommand::class)] | ||
#[UsesClass(SplitCommand::class)] | ||
#[UsesClass(UpdateCommand::class)] | ||
#[UsesClass(JsonFile::class)] | ||
#[UsesClass(Authors::class)] | ||
#[UsesClass(BranchAlias::class)] | ||
#[UsesClass(Funding::class)] | ||
#[UsesClass(Support::class)] | ||
#[UsesClass(ClearSection::class)] | ||
#[UsesClass(UpdateAutoloadDevSection::class)] | ||
#[UsesClass(UpdateAutoloadSection::class)] | ||
#[UsesClass(UpdateProvideSection::class)] | ||
#[UsesClass(UpdateReplaceSection::class)] | ||
#[UsesClass(UpdateRequireSection::class)] | ||
#[UsesClass(UpdateRequireDevSection::class)] | ||
final class MergeCommandTest extends TestCase | ||
{ | ||
private Application $application; | ||
|
||
private MergeCommand $command; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->application = new Application(); | ||
$this->command = $this->application->get('merge'); | ||
} | ||
|
||
public function testItExecutesSuccessfully(): void | ||
{ | ||
$commandTester = new CommandTester($this->command); | ||
|
||
$commandTester->execute([ | ||
'--dry-run' => true, | ||
'-vvv' => true, | ||
]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
src/SonsOfPHP/Bard/Tests/Console/Command/PushCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SonsOfPHP\Bard\Tests\Console\Command; | ||
|
||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\Attributes\UsesClass; | ||
use PHPUnit\Framework\TestCase; | ||
use SonsOfPHP\Bard\Console\Application; | ||
use SonsOfPHP\Bard\Console\Command\AbstractCommand; | ||
use SonsOfPHP\Bard\Console\Command\AddCommand; | ||
use SonsOfPHP\Bard\Console\Command\CopyCommand; | ||
use SonsOfPHP\Bard\Console\Command\InitCommand; | ||
use SonsOfPHP\Bard\Console\Command\InstallCommand; | ||
use SonsOfPHP\Bard\Console\Command\MergeCommand; | ||
use SonsOfPHP\Bard\Console\Command\PullCommand; | ||
use SonsOfPHP\Bard\Console\Command\PushCommand; | ||
use SonsOfPHP\Bard\Console\Command\ReleaseCommand; | ||
use SonsOfPHP\Bard\Console\Command\SplitCommand; | ||
use SonsOfPHP\Bard\Console\Command\UpdateCommand; | ||
use SonsOfPHP\Bard\JsonFile; | ||
use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
#[Group('bard')] | ||
#[CoversClass(PushCommand::class)] | ||
#[UsesClass(Application::class)] | ||
#[UsesClass(AbstractCommand::class)] | ||
#[UsesClass(AddCommand::class)] | ||
#[UsesClass(CopyCommand::class)] | ||
#[UsesClass(InitCommand::class)] | ||
#[UsesClass(InstallCommand::class)] | ||
#[UsesClass(MergeCommand::class)] | ||
#[UsesClass(PullCommand::class)] | ||
#[UsesClass(ReleaseCommand::class)] | ||
#[UsesClass(SplitCommand::class)] | ||
#[UsesClass(UpdateCommand::class)] | ||
#[UsesClass(JsonFile::class)] | ||
#[UsesClass(AddPackageWorker::class)] | ||
final class PushCommandTest extends TestCase | ||
{ | ||
private Application $application; | ||
|
||
private PushCommand $command; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->application = new Application(); | ||
$this->command = $this->application->get('push'); | ||
} | ||
|
||
public function testItExecutesSuccessfully(): void | ||
{ | ||
$commandTester = new CommandTester($this->command); | ||
|
||
$commandTester->execute([ | ||
'--dry-run' => true, | ||
'-vvv' => true, | ||
]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
src/SonsOfPHP/Bard/Tests/Console/Command/ReleaseCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SonsOfPHP\Bard\Tests\Console\Command; | ||
|
||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\Attributes\UsesClass; | ||
use PHPUnit\Framework\TestCase; | ||
use SonsOfPHP\Bard\Console\Application; | ||
use SonsOfPHP\Bard\Console\Command\AbstractCommand; | ||
use SonsOfPHP\Bard\Console\Command\AddCommand; | ||
use SonsOfPHP\Bard\Console\Command\CopyCommand; | ||
use SonsOfPHP\Bard\Console\Command\InitCommand; | ||
use SonsOfPHP\Bard\Console\Command\InstallCommand; | ||
use SonsOfPHP\Bard\Console\Command\MergeCommand; | ||
use SonsOfPHP\Bard\Console\Command\PullCommand; | ||
use SonsOfPHP\Bard\Console\Command\PushCommand; | ||
use SonsOfPHP\Bard\Console\Command\ReleaseCommand; | ||
use SonsOfPHP\Bard\Console\Command\SplitCommand; | ||
use SonsOfPHP\Bard\Console\Command\UpdateCommand; | ||
use SonsOfPHP\Bard\JsonFile; | ||
use SonsOfPHP\Bard\Worker\File\Bard\UpdateVersionWorker; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Package\BranchAlias; | ||
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateReplaceSection; | ||
use SonsOfPHP\Component\Version\Version; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
#[Group('bard')] | ||
#[CoversClass(ReleaseCommand::class)] | ||
#[UsesClass(Application::class)] | ||
#[UsesClass(AbstractCommand::class)] | ||
#[UsesClass(AddCommand::class)] | ||
#[UsesClass(CopyCommand::class)] | ||
#[UsesClass(InitCommand::class)] | ||
#[UsesClass(InstallCommand::class)] | ||
#[UsesClass(MergeCommand::class)] | ||
#[UsesClass(PullCommand::class)] | ||
#[UsesClass(PushCommand::class)] | ||
#[UsesClass(SplitCommand::class)] | ||
#[UsesClass(UpdateCommand::class)] | ||
#[UsesClass(JsonFile::class)] | ||
#[UsesClass(UpdateVersionWorker::class)] | ||
#[UsesClass(BranchAlias::class)] | ||
#[UsesClass(UpdateReplaceSection::class)] | ||
#[UsesClass(Version::class)] | ||
final class ReleaseCommandTest extends TestCase | ||
{ | ||
private Application $application; | ||
|
||
private ReleaseCommand $command; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->application = new Application(); | ||
$this->command = $this->application->get('release'); | ||
} | ||
|
||
public function testItsNameIsCorrect(): void | ||
{ | ||
$commandTester = new CommandTester($this->command); | ||
|
||
$commandTester->execute([ | ||
'release' => 'patch', | ||
'--dry-run' => true, | ||
'-vvv' => true, | ||
]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/SonsOfPHP/Bard/Tests/Console/Command/SplitCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SonsOfPHP\Bard\Tests\Console\Command; | ||
|
||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\Attributes\UsesClass; | ||
use PHPUnit\Framework\TestCase; | ||
use SonsOfPHP\Bard\Console\Application; | ||
use SonsOfPHP\Bard\Console\Command\AbstractCommand; | ||
use SonsOfPHP\Bard\Console\Command\AddCommand; | ||
use SonsOfPHP\Bard\Console\Command\CopyCommand; | ||
use SonsOfPHP\Bard\Console\Command\InitCommand; | ||
use SonsOfPHP\Bard\Console\Command\InstallCommand; | ||
use SonsOfPHP\Bard\Console\Command\MergeCommand; | ||
use SonsOfPHP\Bard\Console\Command\PullCommand; | ||
use SonsOfPHP\Bard\Console\Command\PushCommand; | ||
use SonsOfPHP\Bard\Console\Command\ReleaseCommand; | ||
use SonsOfPHP\Bard\Console\Command\SplitCommand; | ||
use SonsOfPHP\Bard\Console\Command\UpdateCommand; | ||
use SonsOfPHP\Bard\JsonFile; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
#[Group('bard')] | ||
#[CoversClass(SplitCommand::class)] | ||
#[UsesClass(Application::class)] | ||
#[UsesClass(AbstractCommand::class)] | ||
#[UsesClass(AddCommand::class)] | ||
#[UsesClass(CopyCommand::class)] | ||
#[UsesClass(InitCommand::class)] | ||
#[UsesClass(InstallCommand::class)] | ||
#[UsesClass(MergeCommand::class)] | ||
#[UsesClass(PullCommand::class)] | ||
#[UsesClass(PushCommand::class)] | ||
#[UsesClass(ReleaseCommand::class)] | ||
#[UsesClass(UpdateCommand::class)] | ||
#[UsesClass(JsonFile::class)] | ||
final class SplitCommandTest extends TestCase | ||
{ | ||
private Application $application; | ||
|
||
private SplitCommand $command; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->application = new Application(); | ||
$this->command = $this->application->get('split'); | ||
} | ||
|
||
public function testItsNameIsCorrect(): void | ||
{ | ||
$commandTester = new CommandTester($this->command); | ||
|
||
$commandTester->execute([ | ||
'--dry-run' => true, | ||
'-vvv' => true, | ||
]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
Oops, something went wrong.