Skip to content

Commit

Permalink
Added test for Cloud commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Jan 23, 2024
1 parent ea5204c commit 3bd74f8
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/functional/Cloud/Console/Command/CreateCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace functional\Cloud\Console\Command;

use Kiboko\Component\Satellite\Cloud\Console\Command\CreateCommand;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;

class CreateCommandTest extends TestCase
{
public function testCreateCommandWithOneSatellite(): void
{
$application = new Application();
$application->add(new CreateCommand());

$command = $application->find('create');
$commandTester = new CommandTester($command);
$commandTester->execute(
[
'config' => sys_get_temp_dir(),
]
);

$output = $commandTester->getDisplay();
$this->assertStringContainsString('Résultat attendu', $output);

$this->assertSame(0, $commandTester->getStatusCode());
}

public function testCreateCommandWithMultipleSatellite(): void
{
$application = new Application();
$application->add(new CreateCommand());

$command = $application->find('create');
$commandTester = new CommandTester($command);
$commandTester->execute(
[
'config' => sys_get_temp_dir(),
]
);

$output = $commandTester->getDisplay();
$this->assertStringContainsString('Résultat attendu', $output);

$this->assertSame(0, $commandTester->getStatusCode());
}
}
10 changes: 10 additions & 0 deletions tests/functional/Cloud/Console/Command/RemoveCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace functional\Cloud\Console\Command;

class RemoveCommandTest
{

}
10 changes: 10 additions & 0 deletions tests/functional/Cloud/Console/Command/UpdateCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace functional\Cloud\Console\Command;

class UpdateCommandTest
{

}

0 comments on commit 3bd74f8

Please sign in to comment.