Skip to content

Add tests for language-pack command #250

@swissspidy

Description

@swissspidy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Component] CLICLI commands and tooling[Component] TestsFocus on automated testing[Type] BugBugs and regressions in existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions