wp-studio 1.7.8-beta2 → 1.7.8-beta3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/assets/demo.gif +0 -0
- package/dist/cli/{_events-BRGCap7g.mjs → _events-C60cNJ1W.mjs} +1 -1
- package/dist/cli/{index-9Oz-0bqF.mjs → index-D9syEMMz.mjs} +4 -4
- package/dist/cli/{index-CT4S2538.mjs → index-Ru6CUP6w.mjs} +24 -12
- package/dist/cli/{login-D4E3GoXe.mjs → login-C3QlGVbr.mjs} +1 -1
- package/dist/cli/{logout-DE-RoshK.mjs → logout-B63eZwJZ.mjs} +1 -1
- package/dist/cli/main.mjs +2 -1
- package/dist/cli/{resume-DLoXmzNG.mjs → resume-DQT_MK6A.mjs} +1 -1
- package/dist/cli/{set-B0L-QiXT.mjs → set-C805heQS.mjs} +1 -1
- package/dist/cli/{set-B8YYUENH.mjs → set-CjTbueyB.mjs} +1 -1
- package/dist/cli/{status-DEOAA0yx.mjs → status-SnKm1rRP.mjs} +1 -1
- package/dist/cli/{wp-CobSX6C6.mjs → wp-D0HZdudM.mjs} +1 -1
- package/dist/cli/wp-files/sqlite-command/composer.json +4 -3
- package/dist/cli/wp-files/sqlite-command/composer.lock +132 -80
- package/dist/cli/wp-files/sqlite-command/vendor/autoload.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_classmap.php +58 -70
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_namespaces.php +1 -0
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_psr4.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_real.php +5 -5
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_static.php +78 -80
- package/dist/cli/wp-files/sqlite-command/vendor/composer/installed.json +104 -49
- package/dist/cli/wp-files/sqlite-command/vendor/composer/installed.php +29 -16
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/CHANGELOG.md +103 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/Comparator.php +62 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/DateComparator.php +50 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/NumberComparator.php +78 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Exception/AccessDeniedException.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Finder.php +851 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Gitignore.php +91 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Glob.php +116 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/CustomFilterIterator.php +61 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +58 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +48 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +110 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +51 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +58 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +45 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/LazyIterator.php +32 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +107 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/PathFilterIterator.php +56 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +134 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +57 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/SortableIterator.php +115 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +173 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/LICENSE +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/README.md +14 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/SplFileInfo.php +80 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/composer.json +31 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/.gitattributes +8 -0
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache → wp-cli}/mustache/LICENSE +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/README.md +76 -0
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache → wp-cli}/mustache/composer.json +6 -16
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/src/Mustache/Autoloader.php +88 -0
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/AbstractCache.php +7 -15
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/FilesystemCache.php +15 -20
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/NoopCache.php +4 -8
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache.php +7 -10
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Compiler.php +87 -144
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Context.php +19 -23
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Engine.php +134 -251
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/InvalidArgumentException.php +2 -6
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/LogicException.php +2 -6
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/RuntimeException.php +2 -6
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/SyntaxException.php +8 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownFilterException.php +7 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownHelperException.php +7 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownTemplateException.php +7 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception.php +5 -4
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/HelperCollection.php +17 -22
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/LambdaHelper.php +8 -28
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/ArrayLoader.php +9 -12
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/CascadingLoader.php +15 -18
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/FilesystemLoader.php +18 -24
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/InlineLoader.php +13 -19
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/MutableLoader.php +7 -4
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/ProductionFilesystemLoader.php +16 -23
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/StringLoader.php +4 -8
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader.php +7 -8
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger/AbstractLogger.php +26 -22
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger/StreamLogger.php +20 -25
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger.php +37 -13
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Parser.php +93 -100
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Source/FilesystemSource.php +7 -11
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Source.php +5 -4
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Template.php +32 -39
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Tokenizer.php +29 -33
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.actrc +3 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.gitattributes +6 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.mailmap +234 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/README.md +4 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/VERSION +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/CHANGELOG.md +0 -65
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/README.md +1 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/certificates/cacert.pem +372 -315
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/certificates/cacert.pem.sha256 +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/composer.json +5 -7
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Iri.php +18 -20
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Requests.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Response/Headers.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Curl.php +1 -5
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Fsockopen.php +0 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Utility/CaseInsensitiveDictionary.php +0 -12
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Utility/FilteredIterator.php +2 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/composer.json +13 -30
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/dependencies.yml +6 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/manifest.json +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Autoloader.php +2 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/AutoloaderStep.php +1 -10
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/CheckRoot.php +2 -20
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/DefineProtectedCommands.php +3 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php +4 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/IncludeRequestsAutoloader.php +3 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/InitializeContexts.php +0 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/InitializeLogger.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php +3 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/{RegisterShutdownHandler.php → LoadDispatcher.php} +4 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadRequiredCommand.php +5 -9
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadUtilityFunctions.php +0 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Completions.php +6 -149
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Configurator.php +49 -202
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Admin.php +21 -113
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Auto.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Cli.php +1 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Frontend.php +1 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php +26 -63
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php +9 -19
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php +19 -284
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php +5 -17
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Exception/NonExistentKeyException.php +3 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Extractor.php +54 -30
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Base.php +3 -7
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Comment.php +2 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Post.php +3 -8
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Signup.php +1 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Site.php +4 -12
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/User.php +1 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/FileCache.php +33 -135
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Formatter.php +57 -221
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Inflector.php +4 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/CSV.php +1 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php +1 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Table.php +1 -7
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Transform.php +0 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Base.php +0 -15
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Quiet.php +3 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Regular.php +3 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/NoOp.php +0 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Process.php +7 -40
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/RequestsLibrary.php +1 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php +234 -795
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/SynopsisParser.php +26 -116
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/SynopsisValidator.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Traverser/RecursiveDataStructureTraverser.php +26 -69
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/UpgraderSkin.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/WpHttpCacheManager.php +5 -67
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/WpOrgApi.php +3 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/boot-fs.php +2 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/bootstrap.php +2 -5
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/class-wp-cli.php +62 -311
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Alias_Command.php +60 -292
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Cache_Command.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Command.php +31 -191
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/Help_Command.php +35 -177
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/config-spec.php +4 -28
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/utils-wp.php +47 -81
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/utils.php +200 -512
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/wp-cli.php +2 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/wp-settings-cli.php +465 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/templates/man-params.mustache +4 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/templates/man.mustache +0 -8
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ArgValidationTest.php +74 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/CommandFactoryTest.php +420 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ConfiguratorTest.php +87 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/DocParserTest.php +213 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ExtractorTest.php +293 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/FileCacheTest.php +207 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/HelpTest.php +119 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/InflectorTest.php +37 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/LoggingTest.php +124 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ProcessTest.php +30 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/SynopsisParserTest.php +194 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/UtilsTest.php +1092 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WPCLITest.php +16 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/Iterators/CSVTest.php +109 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/Traversers/RecursiveDataStructureTraverserTest.php +151 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/WpOrgApiTest.php +166 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WpVersionCompareTest.php +78 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/bootstrap.php +17 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-class-win.php +70 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-class.php +70 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-function-win.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-function.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/bar.ab2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.ab1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.ac1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.efg2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.ab1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.ab2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.efg1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.efg2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/mock-requests-transport.php +34 -0
- package/dist/cli/wp-files/sqlite-command/version +1 -1
- package/package.json +4 -3
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/.php-cs-fixer.php +0 -20
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/README.md +0 -94
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/src/RenderedString.php +0 -51
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/src/compat.php +0 -282
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.typos.toml +0 -14
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/AGENTS.md +0 -121
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/proxy.py +0 -5
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/start.sh +0 -19
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/stop.sh +0 -10
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Path.php +0 -260
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/ShutdownHandler.php +0 -329
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/schemas/wp-cli-config.json +0 -218
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/schemas/wp-cli.example.yml +0 -55
- /package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/{codecov.yml → tests/data/expand_globs/bar.ab1} +0 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use WP_CLI\Tests\TestCase;
|
|
4
|
+
|
|
5
|
+
class CommandFactoryTest extends TestCase {
|
|
6
|
+
|
|
7
|
+
public static function set_up_before_class() {
|
|
8
|
+
require_once dirname( __DIR__ ) . '/php/class-wp-cli-command.php';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @dataProvider dataProviderExtractLastDocComment
|
|
13
|
+
*/
|
|
14
|
+
public function testExtractLastDocComment( $content, $expected ) {
|
|
15
|
+
// Save and set test env var.
|
|
16
|
+
$is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' );
|
|
17
|
+
putenv( 'WP_CLI_TEST_IS_WINDOWS=0' );
|
|
18
|
+
|
|
19
|
+
static $extract_last_doc_comment = null;
|
|
20
|
+
if ( null === $extract_last_doc_comment ) {
|
|
21
|
+
$extract_last_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'extract_last_doc_comment' );
|
|
22
|
+
$extract_last_doc_comment->setAccessible( true );
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$actual = $extract_last_doc_comment->invoke( null, $content );
|
|
26
|
+
$this->assertSame( $expected, $actual );
|
|
27
|
+
|
|
28
|
+
// Restore.
|
|
29
|
+
putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" );
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @dataProvider dataProviderExtractLastDocComment
|
|
34
|
+
*/
|
|
35
|
+
public function testExtractLastDocCommentWin( $content, $expected ) {
|
|
36
|
+
// Save and set test env var.
|
|
37
|
+
$is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' );
|
|
38
|
+
putenv( 'WP_CLI_TEST_IS_WINDOWS=1' );
|
|
39
|
+
|
|
40
|
+
static $extract_last_doc_comment = null;
|
|
41
|
+
if ( null === $extract_last_doc_comment ) {
|
|
42
|
+
$extract_last_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'extract_last_doc_comment' );
|
|
43
|
+
$extract_last_doc_comment->setAccessible( true );
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
$actual = $extract_last_doc_comment->invoke( null, $content );
|
|
47
|
+
$this->assertSame( $expected, $actual );
|
|
48
|
+
|
|
49
|
+
// Restore.
|
|
50
|
+
putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" );
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public static function dataProviderExtractLastDocComment() {
|
|
54
|
+
return [
|
|
55
|
+
[ '', false ],
|
|
56
|
+
[ '*/', false ],
|
|
57
|
+
[ '/*/ ', false ],
|
|
58
|
+
[ '/**/', false ],
|
|
59
|
+
[ '/***/ */', false ],
|
|
60
|
+
[ '/***/', '/***/' ],
|
|
61
|
+
[ "\n /**\n \n \t\n */ \t\n \n ", "/**\n \n \t\n */" ],
|
|
62
|
+
[ "\r\n /**\r\n \r\n \t\r\n */ \t\r\n \r\n ", "/**\r\n \r\n \t\r\n */" ],
|
|
63
|
+
[ '/**/ /***/ /***/', '/***/' ],
|
|
64
|
+
[ 'asdfasdf/** /** */', '/** /** */' ],
|
|
65
|
+
[ '*//** /** */', '/** /** */' ],
|
|
66
|
+
[ '/** *//** /** */', '/** /** */' ],
|
|
67
|
+
[ '*//** */ /** /** */', '/** /** */' ],
|
|
68
|
+
[ '*//** *//** /** /** */', '/** /** /** */' ],
|
|
69
|
+
|
|
70
|
+
[ '/** */class qwer', '/** */' ],
|
|
71
|
+
[ '/**1*/class qwer{}/**2*/class asdf', '/**2*/' ],
|
|
72
|
+
[ "/** */class qwer {}\nclass asdf", false ],
|
|
73
|
+
[ "/** */class qwer {}\r\nclass asdf", false ],
|
|
74
|
+
|
|
75
|
+
[ '/** */function qwer', '/** */' ],
|
|
76
|
+
[ '/** */function qwer( $function ) {}', '/** */' ],
|
|
77
|
+
[ '/**1*/function qwer() {}/**2*/function asdf()', '/**2*/' ],
|
|
78
|
+
[ "/** */function qwer() {}\nfunction asdf()", false ],
|
|
79
|
+
[ "/** */function qwer() {}\r\nfunction asdf()", false ],
|
|
80
|
+
[ '/** */function qwer() {}function asdf()', false ],
|
|
81
|
+
[ '/** */function qwer() {};function asdf( $function )', false ],
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public function testGetDocComment() {
|
|
86
|
+
// Save and set test env var.
|
|
87
|
+
$get_doc_comment = getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' );
|
|
88
|
+
$is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' );
|
|
89
|
+
|
|
90
|
+
putenv( 'WP_CLI_TEST_GET_DOC_COMMENT=1' );
|
|
91
|
+
putenv( 'WP_CLI_TEST_IS_WINDOWS=0' );
|
|
92
|
+
|
|
93
|
+
// Make private function accessible.
|
|
94
|
+
$get_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'get_doc_comment' );
|
|
95
|
+
$get_doc_comment->setAccessible( true );
|
|
96
|
+
|
|
97
|
+
if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command', false ) ) {
|
|
98
|
+
require __DIR__ . '/data/commandfactory-doc_comment-class.php';
|
|
99
|
+
}
|
|
100
|
+
if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', false ) ) {
|
|
101
|
+
require __DIR__ . '/data/commandfactory-doc_comment-class-win.php';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Class 1.
|
|
105
|
+
|
|
106
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command' );
|
|
107
|
+
$expected = $reflection->getDocComment();
|
|
108
|
+
|
|
109
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
110
|
+
$this->assertSame( $expected, $actual );
|
|
111
|
+
|
|
112
|
+
// Class method 1.
|
|
113
|
+
|
|
114
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command1' );
|
|
115
|
+
$expected = $reflection->getDocComment();
|
|
116
|
+
|
|
117
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
118
|
+
$this->assertSame( $expected, $actual );
|
|
119
|
+
|
|
120
|
+
// Class method 2.
|
|
121
|
+
|
|
122
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command2' );
|
|
123
|
+
$expected = $reflection->getDocComment();
|
|
124
|
+
|
|
125
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
126
|
+
$this->assertSame( $expected, $actual );
|
|
127
|
+
|
|
128
|
+
// Class method 3.
|
|
129
|
+
|
|
130
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command3' );
|
|
131
|
+
$expected = $reflection->getDocComment();
|
|
132
|
+
|
|
133
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
134
|
+
$this->assertSame( $expected, $actual );
|
|
135
|
+
|
|
136
|
+
// Class method 4.
|
|
137
|
+
|
|
138
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command4' );
|
|
139
|
+
$expected = $reflection->getDocComment();
|
|
140
|
+
|
|
141
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
142
|
+
$this->assertSame( $expected, $actual );
|
|
143
|
+
$this->assertFalse( $actual );
|
|
144
|
+
|
|
145
|
+
// Class 1 Windows.
|
|
146
|
+
|
|
147
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win' );
|
|
148
|
+
$expected = $reflection->getDocComment();
|
|
149
|
+
|
|
150
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
151
|
+
$this->assertSame( $expected, $actual );
|
|
152
|
+
|
|
153
|
+
// Class method 1.
|
|
154
|
+
|
|
155
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command1' );
|
|
156
|
+
$expected = $reflection->getDocComment();
|
|
157
|
+
|
|
158
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
159
|
+
$this->assertSame( $expected, $actual );
|
|
160
|
+
|
|
161
|
+
// Class method 2.
|
|
162
|
+
|
|
163
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command2' );
|
|
164
|
+
$expected = $reflection->getDocComment();
|
|
165
|
+
|
|
166
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
167
|
+
$this->assertSame( $expected, $actual );
|
|
168
|
+
|
|
169
|
+
// Class method 3.
|
|
170
|
+
|
|
171
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command3' );
|
|
172
|
+
$expected = $reflection->getDocComment();
|
|
173
|
+
|
|
174
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
175
|
+
$this->assertSame( $expected, $actual );
|
|
176
|
+
|
|
177
|
+
// Class method 4.
|
|
178
|
+
|
|
179
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command4' );
|
|
180
|
+
$expected = $reflection->getDocComment();
|
|
181
|
+
|
|
182
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
183
|
+
$this->assertSame( $expected, $actual );
|
|
184
|
+
$this->assertFalse( $actual );
|
|
185
|
+
|
|
186
|
+
// Class 2.
|
|
187
|
+
|
|
188
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command' );
|
|
189
|
+
$expected = $reflection->getDocComment();
|
|
190
|
+
|
|
191
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
192
|
+
$this->assertSame( $expected, $actual );
|
|
193
|
+
|
|
194
|
+
// Class method 1.
|
|
195
|
+
|
|
196
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command', 'command1' );
|
|
197
|
+
$expected = $reflection->getDocComment();
|
|
198
|
+
|
|
199
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
200
|
+
$this->assertSame( $expected, $actual );
|
|
201
|
+
$this->assertFalse( $actual );
|
|
202
|
+
|
|
203
|
+
// Class 2 Windows.
|
|
204
|
+
|
|
205
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win' );
|
|
206
|
+
$expected = $reflection->getDocComment();
|
|
207
|
+
|
|
208
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
209
|
+
$this->assertSame( $expected, $actual );
|
|
210
|
+
|
|
211
|
+
// Class method 1.
|
|
212
|
+
|
|
213
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win', 'command1' );
|
|
214
|
+
$expected = $reflection->getDocComment();
|
|
215
|
+
|
|
216
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
217
|
+
$this->assertSame( $expected, $actual );
|
|
218
|
+
$this->assertFalse( $actual );
|
|
219
|
+
|
|
220
|
+
// Functions.
|
|
221
|
+
|
|
222
|
+
require __DIR__ . '/data/commandfactory-doc_comment-function.php';
|
|
223
|
+
|
|
224
|
+
// Function 1.
|
|
225
|
+
|
|
226
|
+
$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_1' );
|
|
227
|
+
$expected = $reflection->getDocComment();
|
|
228
|
+
|
|
229
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
230
|
+
$this->assertSame( $expected, $actual );
|
|
231
|
+
|
|
232
|
+
// Function 2.
|
|
233
|
+
|
|
234
|
+
$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_2' );
|
|
235
|
+
$expected = $reflection->getDocComment();
|
|
236
|
+
|
|
237
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
238
|
+
$this->assertSame( $expected, $actual );
|
|
239
|
+
|
|
240
|
+
// Function 3.
|
|
241
|
+
|
|
242
|
+
$reflection = new \ReflectionFunction( $commandfactorytests_get_doc_comment_func_3 );
|
|
243
|
+
$expected = $reflection->getDocComment();
|
|
244
|
+
|
|
245
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
246
|
+
$this->assertSame( $expected, $actual );
|
|
247
|
+
|
|
248
|
+
// Restore.
|
|
249
|
+
putenv( false === $get_doc_comment ? 'WP_CLI_TEST_GET_DOC_COMMENT' : "WP_CLI_TEST_GET_DOC_COMMENT=$get_doc_comment" );
|
|
250
|
+
putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" );
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
public function testGetDocCommentWin() {
|
|
254
|
+
// Save and set test env var.
|
|
255
|
+
$get_doc_comment = getenv( 'WP_CLI_TEST_GET_DOC_COMMENT' );
|
|
256
|
+
$is_windows = getenv( 'WP_CLI_TEST_IS_WINDOWS' );
|
|
257
|
+
|
|
258
|
+
putenv( 'WP_CLI_TEST_GET_DOC_COMMENT=1' );
|
|
259
|
+
putenv( 'WP_CLI_TEST_IS_WINDOWS=1' );
|
|
260
|
+
|
|
261
|
+
// Make private function accessible.
|
|
262
|
+
$get_doc_comment = new \ReflectionMethod( 'WP_CLI\Dispatcher\CommandFactory', 'get_doc_comment' );
|
|
263
|
+
$get_doc_comment->setAccessible( true );
|
|
264
|
+
|
|
265
|
+
if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command', false ) ) {
|
|
266
|
+
require __DIR__ . '/data/commandfactory-doc_comment-class.php';
|
|
267
|
+
}
|
|
268
|
+
if ( ! class_exists( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', false ) ) {
|
|
269
|
+
require __DIR__ . '/data/commandfactory-doc_comment-class-win.php';
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Class 1.
|
|
273
|
+
|
|
274
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command' );
|
|
275
|
+
$expected = $reflection->getDocComment();
|
|
276
|
+
|
|
277
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
278
|
+
$this->assertSame( $expected, $actual );
|
|
279
|
+
|
|
280
|
+
// Class method 1.
|
|
281
|
+
|
|
282
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command1' );
|
|
283
|
+
$expected = $reflection->getDocComment();
|
|
284
|
+
|
|
285
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
286
|
+
$this->assertSame( $expected, $actual );
|
|
287
|
+
|
|
288
|
+
// Class method 2.
|
|
289
|
+
|
|
290
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command2' );
|
|
291
|
+
$expected = $reflection->getDocComment();
|
|
292
|
+
|
|
293
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
294
|
+
$this->assertSame( $expected, $actual );
|
|
295
|
+
|
|
296
|
+
// Class method 3.
|
|
297
|
+
|
|
298
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command3' );
|
|
299
|
+
$expected = $reflection->getDocComment();
|
|
300
|
+
|
|
301
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
302
|
+
$this->assertSame( $expected, $actual );
|
|
303
|
+
|
|
304
|
+
// Class method 4.
|
|
305
|
+
|
|
306
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command', 'command4' );
|
|
307
|
+
$expected = $reflection->getDocComment();
|
|
308
|
+
|
|
309
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
310
|
+
$this->assertSame( $expected, $actual );
|
|
311
|
+
$this->assertFalse( $actual );
|
|
312
|
+
|
|
313
|
+
// Class 1 Windows.
|
|
314
|
+
|
|
315
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win' );
|
|
316
|
+
$expected = $reflection->getDocComment();
|
|
317
|
+
|
|
318
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
319
|
+
$this->assertSame( $expected, $actual );
|
|
320
|
+
|
|
321
|
+
// Class method 1.
|
|
322
|
+
|
|
323
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command1' );
|
|
324
|
+
$expected = $reflection->getDocComment();
|
|
325
|
+
|
|
326
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
327
|
+
$this->assertSame( $expected, $actual );
|
|
328
|
+
|
|
329
|
+
// Class method 2.
|
|
330
|
+
|
|
331
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command2' );
|
|
332
|
+
$expected = $reflection->getDocComment();
|
|
333
|
+
|
|
334
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
335
|
+
$this->assertSame( $expected, $actual );
|
|
336
|
+
|
|
337
|
+
// Class method 3.
|
|
338
|
+
|
|
339
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command3' );
|
|
340
|
+
$expected = $reflection->getDocComment();
|
|
341
|
+
|
|
342
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
343
|
+
$this->assertSame( $expected, $actual );
|
|
344
|
+
|
|
345
|
+
// Class method 4.
|
|
346
|
+
|
|
347
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_1_Command_Win', 'command4' );
|
|
348
|
+
$expected = $reflection->getDocComment();
|
|
349
|
+
|
|
350
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
351
|
+
$this->assertSame( $expected, $actual );
|
|
352
|
+
$this->assertFalse( $actual );
|
|
353
|
+
|
|
354
|
+
// Class 2.
|
|
355
|
+
|
|
356
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command' );
|
|
357
|
+
$expected = $reflection->getDocComment();
|
|
358
|
+
|
|
359
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
360
|
+
$this->assertSame( $expected, $actual );
|
|
361
|
+
|
|
362
|
+
// Class method 1.
|
|
363
|
+
|
|
364
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command', 'command1' );
|
|
365
|
+
$expected = $reflection->getDocComment();
|
|
366
|
+
|
|
367
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
368
|
+
$this->assertSame( $expected, $actual );
|
|
369
|
+
$this->assertFalse( $actual );
|
|
370
|
+
|
|
371
|
+
// Class 2 Windows.
|
|
372
|
+
|
|
373
|
+
$reflection = new \ReflectionClass( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win' );
|
|
374
|
+
$expected = $reflection->getDocComment();
|
|
375
|
+
|
|
376
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
377
|
+
$this->assertSame( $expected, $actual );
|
|
378
|
+
|
|
379
|
+
// Class method 1.
|
|
380
|
+
|
|
381
|
+
$reflection = new \ReflectionMethod( 'CommandFactoryTests_Get_Doc_Comment_2_Command_Win', 'command1' );
|
|
382
|
+
$expected = $reflection->getDocComment();
|
|
383
|
+
|
|
384
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
385
|
+
$this->assertSame( $expected, $actual );
|
|
386
|
+
$this->assertFalse( $actual );
|
|
387
|
+
|
|
388
|
+
// Functions.
|
|
389
|
+
|
|
390
|
+
require __DIR__ . '/data/commandfactory-doc_comment-function-win.php';
|
|
391
|
+
|
|
392
|
+
// Function 1 Windows.
|
|
393
|
+
|
|
394
|
+
$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_1_win' );
|
|
395
|
+
$expected = $reflection->getDocComment();
|
|
396
|
+
|
|
397
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
398
|
+
$this->assertSame( $expected, $actual );
|
|
399
|
+
|
|
400
|
+
// Function 2.
|
|
401
|
+
|
|
402
|
+
$reflection = new \ReflectionFunction( 'commandfactorytests_get_doc_comment_func_2_win' );
|
|
403
|
+
$expected = $reflection->getDocComment();
|
|
404
|
+
|
|
405
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
406
|
+
$this->assertSame( $expected, $actual );
|
|
407
|
+
|
|
408
|
+
// Function 3.
|
|
409
|
+
|
|
410
|
+
$reflection = new \ReflectionFunction( $commandfactorytests_get_doc_comment_func_3_win );
|
|
411
|
+
$expected = $reflection->getDocComment();
|
|
412
|
+
|
|
413
|
+
$actual = $get_doc_comment->invoke( null, $reflection );
|
|
414
|
+
$this->assertSame( $expected, $actual );
|
|
415
|
+
|
|
416
|
+
// Restore.
|
|
417
|
+
putenv( false === $get_doc_comment ? 'WP_CLI_TEST_GET_DOC_COMMENT' : "WP_CLI_TEST_GET_DOC_COMMENT=$get_doc_comment" );
|
|
418
|
+
putenv( false === $is_windows ? 'WP_CLI_TEST_IS_WINDOWS' : "WP_CLI_TEST_IS_WINDOWS=$is_windows" );
|
|
419
|
+
}
|
|
420
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use WP_CLI\Configurator;
|
|
4
|
+
use WP_CLI\Loggers;
|
|
5
|
+
use WP_CLI\Tests\TestCase;
|
|
6
|
+
|
|
7
|
+
class ConfiguratorTest extends TestCase {
|
|
8
|
+
|
|
9
|
+
public function testExtractAssoc() {
|
|
10
|
+
$args = Configurator::extract_assoc( [ 'foo', '--bar', '--baz=text' ] );
|
|
11
|
+
|
|
12
|
+
$this->assertCount( 1, $args[0] );
|
|
13
|
+
$this->assertCount( 2, $args[1] );
|
|
14
|
+
|
|
15
|
+
$this->assertEquals( 'foo', $args[0][0] );
|
|
16
|
+
|
|
17
|
+
$this->assertEquals( 'bar', $args[1][0][0] );
|
|
18
|
+
$this->assertTrue( $args[1][0][1] );
|
|
19
|
+
|
|
20
|
+
$this->assertEquals( 'baz', $args[1][1][0] );
|
|
21
|
+
$this->assertEquals( 'text', $args[1][1][1] );
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public function testExtractAssocNoValue() {
|
|
25
|
+
$args = Configurator::extract_assoc( [ 'foo', '--bar=', '--baz=text' ] );
|
|
26
|
+
|
|
27
|
+
$this->assertCount( 1, $args[0] );
|
|
28
|
+
$this->assertCount( 2, $args[1] );
|
|
29
|
+
|
|
30
|
+
$this->assertEquals( 'foo', $args[0][0] );
|
|
31
|
+
|
|
32
|
+
$this->assertEquals( 'bar', $args[1][0][0] );
|
|
33
|
+
$this->assertEmpty( $args[1][0][1] );
|
|
34
|
+
|
|
35
|
+
$this->assertEquals( 'baz', $args[1][1][0] );
|
|
36
|
+
$this->assertEquals( 'text', $args[1][1][1] );
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public function testExtractAssocGlobalLocal() {
|
|
40
|
+
$args = Configurator::extract_assoc( [ '--url=foo.dev', '--path=wp', 'foo', '--bar=', '--baz=text', '--url=bar.dev' ] );
|
|
41
|
+
|
|
42
|
+
$this->assertCount( 1, $args[0] );
|
|
43
|
+
$this->assertCount( 5, $args[1] );
|
|
44
|
+
$this->assertCount( 2, $args[2] );
|
|
45
|
+
$this->assertCount( 3, $args[3] );
|
|
46
|
+
|
|
47
|
+
$this->assertEquals( 'url', $args[2][0][0] );
|
|
48
|
+
$this->assertEquals( 'foo.dev', $args[2][0][1] );
|
|
49
|
+
$this->assertEquals( 'url', $args[3][2][0] );
|
|
50
|
+
$this->assertEquals( 'bar.dev', $args[3][2][1] );
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public function testExtractAssocDoubleDashInValue() {
|
|
54
|
+
$args = Configurator::extract_assoc( [ '--test=text--text' ] );
|
|
55
|
+
|
|
56
|
+
$this->assertCount( 0, $args[0] );
|
|
57
|
+
$this->assertCount( 1, $args[1] );
|
|
58
|
+
|
|
59
|
+
$this->assertEquals( 'test', $args[1][0][0] );
|
|
60
|
+
$this->assertEquals( 'text--text', $args[1][0][1] );
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* WP_CLI::get_config does not show warnings for null values.
|
|
65
|
+
*/
|
|
66
|
+
public function testNullGetConfig() {
|
|
67
|
+
// Init config so there is a config to check.
|
|
68
|
+
$runner = WP_CLI::get_runner();
|
|
69
|
+
$runner->init_config();
|
|
70
|
+
|
|
71
|
+
// Previous.
|
|
72
|
+
$prev_logger = WP_CLI::get_logger();
|
|
73
|
+
|
|
74
|
+
$logger = new Loggers\Execution();
|
|
75
|
+
WP_CLI::set_logger( $logger );
|
|
76
|
+
|
|
77
|
+
$has_config = WP_CLI::has_config( 'url' );
|
|
78
|
+
$get_config = WP_CLI::get_config( 'url' );
|
|
79
|
+
|
|
80
|
+
$this->assertTrue( $has_config, 'has_config() is not true' );
|
|
81
|
+
$this->assertTrue( false === strpos( $logger->stderr, 'Warning' ), 'Logger contains a "Warning"' );
|
|
82
|
+
$this->assertNull( $get_config, 'get_config() is not null' );
|
|
83
|
+
|
|
84
|
+
// Restore.
|
|
85
|
+
WP_CLI::set_logger( $prev_logger );
|
|
86
|
+
}
|
|
87
|
+
}
|