Skip to content

Commit

Permalink
for console v7
Browse files Browse the repository at this point in the history
  • Loading branch information
kermage committed Feb 16, 2024
1 parent dc05104 commit 097dba5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class AnalyseCommand extends Command {

protected function configure(): void {

// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->setName( self::$defaultName );
$this->setDescription( self::$defaultDescription );
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->addArgument( 'path', InputArgument::OPTIONAL, 'Specify the analyse path', './src' );
$this->addArgument( 'extra', InputArgument::IS_ARRAY, 'To be passed to <info>phpstan</info>', array() );

Expand Down
4 changes: 4 additions & 0 deletions src/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class DumpCommand extends Command {

protected function configure(): void {

// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->setName( self::$defaultName );
$this->setDescription( self::$defaultDescription );
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->addArgument( 'path', InputArgument::OPTIONAL, 'Specify the dump path', './' );

}
Expand Down
4 changes: 4 additions & 0 deletions src/FixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class FixCommand extends Command {

protected function configure(): void {

// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->setName( self::$defaultName );
$this->setDescription( self::$defaultDescription );
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->addArgument( 'path', InputArgument::OPTIONAL, 'Specify the fix path', './src' );
$this->addArgument( 'extra', InputArgument::IS_ARRAY, 'To be passed to <info>phpcbf</info>', array() );

Expand Down
4 changes: 4 additions & 0 deletions src/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class LintCommand extends Command {

protected function configure(): void {

// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->setName( self::$defaultName );
$this->setDescription( self::$defaultDescription );
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->addArgument( 'path', InputArgument::OPTIONAL, 'Specify the lint path', './src' );
$this->addArgument( 'extra', InputArgument::IS_ARRAY, 'To be passed to <info>phpcs</info>', array() );

Expand Down
4 changes: 4 additions & 0 deletions src/SetupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class SetupCommand extends Command {

protected function configure(): void {

// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->setName( self::$defaultName );
$this->setDescription( self::$defaultDescription );
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->addOption( 'db-name', null, InputOption::VALUE_OPTIONAL, 'Name of the database', 'local' );
$this->addOption( 'db-user', null, InputOption::VALUE_OPTIONAL, 'DB Authentication: Username', 'root' );
$this->addOption( 'db-pass', null, InputOption::VALUE_OPTIONAL, 'DB Authentication: Password', 'root' );
Expand Down
4 changes: 4 additions & 0 deletions src/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class TestCommand extends Command {

protected function configure(): void {

// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->setName( self::$defaultName );
$this->setDescription( self::$defaultDescription );
// phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$this->addArgument( 'path', InputArgument::OPTIONAL, 'Specify the test path', './tests' );
$this->addArgument( 'extra', InputArgument::IS_ARRAY, 'To be passed to <info>phpunit</info>', array() );
$this->addOption( 'type', null, InputOption::VALUE_REQUIRED, 'Filter which testsuite to run', 'default' );
Expand Down
4 changes: 4 additions & 0 deletions tests/Commands/TestCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public function testExecute(): void {
'integration',
);

if ( defined( 'WP_TESTS_TABLE_PREFIX' ) ) {
unset( $types[0] );
}

foreach ( $types as $type ) {
ob_start();
$tester->execute( array( '--type' => $type ) );
Expand Down

0 comments on commit 097dba5

Please sign in to comment.