Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for language-pack command #250

Open
swissspidy opened this issue Dec 4, 2022 · 0 comments
Open

Add tests for language-pack command #250

swissspidy opened this issue Dec 4, 2022 · 0 comments
Labels
[Component] CLI CLI commands and tooling [Component] Tests Focus on automated testing [Type] Bug Bugs and regressions in existing functionality

Comments

@swissspidy
Copy link
Collaborator

Issue Overview

Especially needed because of this bug where $projects is immediately overridden, so using --all doesn't really work:

$projects = [];
if ( $all ) {
$projects = $this->get_all_projects();
}
$projects = array_map(
function ( $project_id ) {
$project = ( new ProjectLocator( $project_id ) )->get_project();
if ( ! $project ) {
WP_CLI::log( sprintf( 'Project (ID: %d) does not exist.', $project_id ) );
return null;
}
if ( ! $project->is_active() ) {
WP_CLI::log( sprintf( 'Project (ID: %d) is inactive.', $project->get_id() ) );
return null;
}
return $project;
},
$args
);

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions

  • Browser:
  • PHP:
  • WP-CLI:
  • GlotPress:
  • WordPress:

Additional context

@swissspidy swissspidy added [Type] Bug Bugs and regressions in existing functionality [Component] CLI CLI commands and tooling [Component] Tests Focus on automated testing labels Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] CLI CLI commands and tooling [Component] Tests Focus on automated testing [Type] Bug Bugs and regressions in existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant