-
Notifications
You must be signed in to change notification settings - Fork 7
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
cd9ed63
commit da53fa9
Showing
7 changed files
with
183 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
include_once __DIR__ . '/src/CustomCommand.php'; | ||
|
||
\PHPUnuhi\AppManager::registerExtensionCommand(new CustomCommand()); |
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,23 @@ | ||
<phpunuhi | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../schema/dev-main.xsd" | ||
bootstrap="autoload.php" | ||
> | ||
|
||
<translations> | ||
|
||
<set name="json"> | ||
<format> | ||
<json indent="2" sort="true"/> | ||
</format> | ||
<locales> | ||
<locale name="de">./de.json</locale> | ||
<locale name="en" base="true">./en.json</locale> | ||
<locale name="nl">./nl.json</locale> | ||
</locales> | ||
|
||
</set> | ||
|
||
</translations> | ||
|
||
</phpunuhi> |
34 changes: 34 additions & 0 deletions
34
tests/svrunit/fixtures/custom-command/src/CustomCommand.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,34 @@ | ||
<?php | ||
|
||
use PHPUnuhi\Traits\CommandTrait; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Style\SymfonyStyle; | ||
|
||
class CustomCommand extends Command | ||
{ | ||
use CommandTrait; | ||
|
||
/** | ||
* @return void | ||
*/ | ||
protected function configure(): void | ||
{ | ||
$this | ||
->setName('custom:command-xy') | ||
->setDescription('Custom Command') | ||
->addOption('configuration', null, InputOption::VALUE_REQUIRED, '', ''); | ||
|
||
parent::configure(); | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$io = new SymfonyStyle($input, $output); | ||
$io->title('PHPUnuhi Custom Command XY'); | ||
|
||
return 0; | ||
} | ||
} |
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,5 @@ | ||
commands: | ||
|
||
- name: "custom:command-xy from extension is working" | ||
command: "(($EXEC)) custom:command-xy --configuration=./tests/svrunit/fixtures/custom-command/phpunuhi.xml" | ||
expected: "PHPUnuhi Custom Command XY" |