-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no-issue - Add smock test on command
- Loading branch information
1 parent
3925762
commit f0a5c5f
Showing
19 changed files
with
351 additions
and
30 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
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
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
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
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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
tests/Functional/Command/Anonymization/AnonymizeCommandTest.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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command\Anonymization; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class AnonymizeCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:anonymization:run'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute( | ||
[ | ||
'--force' => true | ||
], | ||
[ | ||
'interactive' => false, | ||
'capture_stderr_separately' => true | ||
] | ||
); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/Functional/Command/Anonymization/AnonymizerListCommandTest.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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command\Anonymization; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class AnonymizerListCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:anonymization:list'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute( | ||
[], | ||
[ | ||
'capture_stderr_separately' => true | ||
] | ||
); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/Functional/Command/Anonymization/CleanCommandTest.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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command\Anonymization; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class CleanCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:anonymization:clean'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute( | ||
[ | ||
'--force' => true | ||
], | ||
[ | ||
'interactive' => false, | ||
'capture_stderr_separately' => true | ||
] | ||
); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/Functional/Command/Anonymization/ConfigCheckCommandTest.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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command\Anonymization; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class ConfigCheckCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:anonymization:config-check'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute( | ||
[], | ||
[ | ||
'interactive' => false, | ||
'capture_stderr_separately' => true | ||
] | ||
); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class BackupCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:backup'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute([]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class CheckCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:check'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute([]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MakinaCorpus\DbToolsBundle\Tests\Functional\Command; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class GdprifyCommandTest extends KernelTestCase | ||
{ | ||
public function testExecute(): void | ||
{ | ||
$this->markTestSkipped("Hard to test for know."); | ||
|
||
$kernel = self::bootKernel(); | ||
$application = new Application($kernel); | ||
|
||
$command = $application->find('db-tools:gdprify'); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute([]); | ||
|
||
$commandTester->assertCommandIsSuccessful(); | ||
} | ||
} |
Oops, something went wrong.