Skip to content

Commit

Permalink
introduces PostInstallStrategy unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Sep 4, 2024
1 parent ba3c749 commit ec62009
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/PostInstallStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
use KevinGH\Box\Configuration\Configuration;
use KevinGH\Box\Json\Json;

use stdClass;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;

use stdClass;
use function dirname;
use function file_exists;
use function realpath;
Expand Down
40 changes: 40 additions & 0 deletions tests/unit/PostInstallStrategyTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php declare(strict_types=1);
/**
* This file is part of the BoxManifest package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Bartlett\BoxManifest\Tests;

use Bartlett\BoxManifest\Composer\ManifestFactory;
use Bartlett\BoxManifest\Composer\PostInstallStrategy;

use KevinGH\Box\Configuration\Configuration;

use PHPUnit\Framework\Attributes\CoversClass;

use stdClass;

/**
* Unit tests for PostInstallStrategy component of the Box Manifest
*
* @author Laurent Laville
* @since Release 4.0.0
*/
#[CoversClass(PostInstallStrategy::class)]
final class PostInstallStrategyTest extends AbstractStrategyTestCase
{
protected function setUp(): void
{
$configFilePath = __DIR__ . '/../fixtures/phario-manifest-2.0.x-dev/box.json';

$raw = new stdClass();
$main = 'main';
$raw->{$main} = false;
$config = Configuration::create($configFilePath, $raw);

$factory = new ManifestFactory($config, true, '4.x-dev', '4.x-dev', true);
$this->strategy = new PostInstallStrategy($factory);
}
}

0 comments on commit ec62009

Please sign in to comment.