function testExtractAssocDoubleDashInValue() { $args = Configurator::extract_assoc(array('--test=text--text')); $this->assertCount(0, $args[0]); $this->assertCount(1, $args[1]); $this->assertEquals('test', $args[1][0][0]); $this->assertEquals('text--text', $args[1][0][1]); }
<?php define('WP_CLI_ROOT', dirname(dirname(__FILE__))); require WP_CLI_ROOT . '/vendor/autoload.php'; require WP_CLI_ROOT . '/php/utils.php'; use Symfony\Component\Finder\Finder; use WP_CLI\Utils; use WP_CLI\Configurator; $configurator = new Configurator(WP_CLI_ROOT . '/utils/make-phar-spec.php'); list($args, $assoc_args, $runtime_config) = $configurator->parse_args(array_slice($GLOBALS['argv'], 1)); if (!isset($args[0]) || empty($args[0])) { echo "usage: php -dphar.readonly=0 {$argv['0']} <path> [--quiet] [--version=same|patch|minor|major|x.y.z] [--store-version]\n"; exit(1); } define('DEST_PATH', $args[0]); define('BE_QUIET', isset($runtime_config['quiet']) && $runtime_config['quiet']); $current_version = trim(file_get_contents(WP_CLI_ROOT . '/VERSION')); if (isset($runtime_config['version'])) { $new_version = $runtime_config['version']; $new_version = Utils\increment_version($current_version, $new_version); if (isset($runtime_config['store-version']) && $runtime_config['store-version']) { file_put_contents(WP_CLI_ROOT . '/VERSION', $new_version); } $current_version = $new_version; } function add_file($phar, $path) { $key = str_replace(WP_CLI_ROOT, '', $path); if (!BE_QUIET) { echo "{$key} - {$path}\n"; }