From 116f8c4eccb1fe4084822f0b393de9721cec79d7 Mon Sep 17 00:00:00 2001 From: rubynguyen1510 Date: Fri, 9 Dec 2022 13:17:44 +0700 Subject: [PATCH 01/11] Adds completion specs for phpunit --- src/phpunit.ts | 125 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 src/phpunit.ts diff --git a/src/phpunit.ts b/src/phpunit.ts new file mode 100644 index 000000000000..f78636517109 --- /dev/null +++ b/src/phpunit.ts @@ -0,0 +1,125 @@ +const completionSpec: Fig.Spec = { + name: "phpunit", + description: "", + options: + [ + { + name: ["--log-junit"], + description: "Log test execution in JUnit XML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--log-teamcity"], + description: "Log test execution in TeamCity format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-html"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-text"], + description: "Write agile documentation in Text format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-xml"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--reverse-list"], + description: "Print defects in reverse order", + }, + { + name: ["--no-logging"], + description: "Ignore logging configuration", + }, + { + name: ["--prepend"], + description: "A PHP script that is included as early as possible", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--bootstrap"], + description: "A PHP script that is included before the tests run", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["-c", "--configuration"], + description: "Read configuration from XML file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--no-configuration"], + description: "Ignore default configuration file (phpunit.xml)", + }, + { + name: ["--extensions"], + description: "A comma separated list of PHPUnit extensions to load", + args: { + name: "extensions", + }, + }, + { + name: ["--no-extensions"], + description: "Do not load PHPUnit extensions", + }, + { + name: ["--include-path"], + description: "Prepend PHP's include_path with given path(s)", + args: { + name: "path(s)", + }, + }, + { + name: ["-d"], + description: "Sets a php.ini value", + args: { + name: "key[=value]", + }, + }, + { + name: ["--cache-result-file"], + description: "Specify result cache path and filename", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--generate-configuration"], + description: "Generate configuration file with suggested settings", + }, + { + name: ["--migrate-configuration"], + description: "Migrate configuration file to current format", + }, + ], +}; +export default completionSpec; From f58d523b93f3700f8d02f15ebddbfad40e6cd730 Mon Sep 17 00:00:00 2001 From: Miguel Lopez <92610991+SimplyMiguel@users.noreply.github.com> Date: Fri, 9 Dec 2022 10:17:18 -0800 Subject: [PATCH 02/11] Add files via upload Added my contribution of phpunit --- src/phpunit.ts | 229 +++++++++++++++++++++++-------------------------- 1 file changed, 109 insertions(+), 120 deletions(-) diff --git a/src/phpunit.ts b/src/phpunit.ts index f78636517109..ba4885c161b6 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -1,125 +1,114 @@ +// Code Coverage Options: +const coverageCloverOption: Fig.Option = { + name: ["--coverage-clover"], + description: "Generate code coverage report in Clover XML format," +}; + +const coverageCrap4jOption: Fig.Option = { + name: ["--coverage-crap4j"], + description: "Generate code coverage report in Crap4J XML format", +}; + +const coverageHtmlOption: Fig.Option = { + name: ["--coverage-html"], + description: "Generate code coverage report in HTML format", +}; + +const coveragePhpOption: Fig.Option = { + name: ["--coverage-php"], + description: "Export PHP_CodeCoverage object to file", +}; + +const coverageTextOption: Fig.Option = { + name: ["--coverage-text="], + description: + " Generate code coverage report in text format [default: standard output]", +}; + +const coverageXmlOption: Fig.Option = { + name: ["--coverage-xml"], + description: "Generate code coverage report in PHPUnit XML format", +}; + +const coverageCacheOption: Fig.Option = { + name: ["--coverage-cache"], + description: "Cache static analysis results", +}; + +const warmCoverageCacheOption: Fig.Option = { + name: ["--warm-coverage-cache"], + description: "Warm static analysis cache", +}; + +const coverageFilterOption: Fig.Option = { + name: ["--coverage-filter"], + description: "Include in code coverage analysis", +}; + +const pathCoverageOption: Fig.Option = { + name: ["--path-coverage"], + description: "Perform path coverage analysis", +}; + +const disableCoverageIgnoreOption: Fig.Option = { + name: ["--disable-coverage-ignore"], + description: "Disable annotations for ignoring code coverage", +}; + +const noCoverageOption: Fig.Option = { + name: ["--no-coverage"], + description: "Ignore code coverage configuration", +}; + + +// Test Execution Options: + +const dontReportUselessTestsOption: Fig.Option = { + name: ["--dont-report-useless-tests"], + description: "Do not report tests that do not test anything", +}; + +const strictCoverageOption: Fig.Option = { + name: ["--strict-coverage"], + description: "Be strict about @covers annotation usage", +}; + +const strictGlobalStateOption: Fig.Option = { + name: ["--strict-global-state"], + description: "Be strict about changes to global state", +}; + + const completionSpec: Fig.Spec = { name: "phpunit", - description: "", - options: - [ - { - name: ["--log-junit"], - description: "Log test execution in JUnit XML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--log-teamcity"], - description: "Log test execution in TeamCity format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-html"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-text"], - description: "Write agile documentation in Text format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-xml"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--reverse-list"], - description: "Print defects in reverse order", - }, - { - name: ["--no-logging"], - description: "Ignore logging configuration", - }, - { - name: ["--prepend"], - description: "A PHP script that is included as early as possible", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--bootstrap"], - description: "A PHP script that is included before the tests run", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["-c", "--configuration"], - description: "Read configuration from XML file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--no-configuration"], - description: "Ignore default configuration file (phpunit.xml)", - }, - { - name: ["--extensions"], - description: "A comma separated list of PHPUnit extensions to load", - args: { - name: "extensions", - }, - }, - { - name: ["--no-extensions"], - description: "Do not load PHPUnit extensions", - }, - { - name: ["--include-path"], - description: "Prepend PHP's include_path with given path(s)", - args: { - name: "path(s)", - }, - }, - { - name: ["-d"], - description: "Sets a php.ini value", - args: { - name: "key[=value]", - }, - }, - { - name: ["--cache-result-file"], - description: "Specify result cache path and filename", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--generate-configuration"], - description: "Generate configuration file with suggested settings", - }, - { - name: ["--migrate-configuration"], - description: "Migrate configuration file to current format", - }, + description: + "The PHPUnit is a command-line test runner that can be invoked through the phpunit command", + options: [ + + // Code Coverage Options: + coverageCloverOption, + coverageCrap4jOption, + coverageHtmlOption, + coveragePhpOption, + coverageTextOption, + coverageXmlOption, + coverageCacheOption, + warmCoverageCacheOption, + coverageFilterOption, + pathCoverageOption, + disableCoverageIgnoreOption, + noCoverageOption, + + // Test Execution Option: + dontReportUselessTestsOption, + strictCoverageOption, + strictGlobalStateOption, + + ], }; + + export default completionSpec; + + From c19119c2f0e538f3a8f84551150841cc9fc60ada Mon Sep 17 00:00:00 2001 From: rubynguyen1510 <50710444+rubynguyen1510@users.noreply.github.com> Date: Fri, 9 Dec 2022 10:27:59 -0800 Subject: [PATCH 03/11] Add logging and configuring options --- src/phpunit.ts | 126 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 2 deletions(-) diff --git a/src/phpunit.ts b/src/phpunit.ts index ba4885c161b6..632e70c020db 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -108,7 +108,129 @@ const completionSpec: Fig.Spec = { ], }; - +const completionSpec: Fig.Spec = { + name: "phpunit", + description: "", + options: + [ + { + name: ["--log-junit"], + description: "Log test execution in JUnit XML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--log-teamcity"], + description: "Log test execution in TeamCity format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-html"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-text"], + description: "Write agile documentation in Text format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-xml"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--reverse-list"], + description: "Print defects in reverse order", + }, + { + name: ["--no-logging"], + description: "Ignore logging configuration", + }, + { + name: ["--prepend"], + description: "A PHP script that is included as early as possible", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--bootstrap"], + description: "A PHP script that is included before the tests run", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["-c", "--configuration"], + description: "Read configuration from XML file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--no-configuration"], + description: "Ignore default configuration file (phpunit.xml)", + }, + { + name: ["--extensions"], + description: "A comma separated list of PHPUnit extensions to load", + args: { + name: "extensions", + }, + }, + { + name: ["--no-extensions"], + description: "Do not load PHPUnit extensions", + }, + { + name: ["--include-path"], + description: "Prepend PHP's include_path with given path(s)", + args: { + name: "path(s)", + }, + }, + { + name: ["-d"], + description: "Sets a php.ini value", + args: { + name: "key[=value]", + }, + }, + { + name: ["--cache-result-file"], + description: "Specify result cache path and filename", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--generate-configuration"], + description: "Generate configuration file with suggested settings", + }, + { + name: ["--migrate-configuration"], + description: "Migrate configuration file to current format", + }, + ], +}; export default completionSpec; - From aaa1bb8691a42dd65ec38f26060fe61d6ddc0a01 Mon Sep 17 00:00:00 2001 From: Miguel Lopez <92610991+SimplyMiguel@users.noreply.github.com> Date: Fri, 9 Dec 2022 10:39:51 -0800 Subject: [PATCH 04/11] Add files via upload --- src/phpunit.ts | 122 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 119 insertions(+), 3 deletions(-) diff --git a/src/phpunit.ts b/src/phpunit.ts index ba4885c161b6..a968209423f0 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -103,12 +103,128 @@ const completionSpec: Fig.Spec = { dontReportUselessTestsOption, strictCoverageOption, strictGlobalStateOption, + { + name: ["--log-junit"], + description: "Log test execution in JUnit XML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--log-teamcity"], + description: "Log test execution in TeamCity format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-html"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-text"], + description: "Write agile documentation in Text format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-xml"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--reverse-list"], + description: "Print defects in reverse order", + }, + { + name: ["--no-logging"], + description: "Ignore logging configuration", + }, + { + name: ["--prepend"], + description: "A PHP script that is included as early as possible", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--bootstrap"], + description: "A PHP script that is included before the tests run", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["-c", "--configuration"], + description: "Read configuration from XML file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--no-configuration"], + description: "Ignore default configuration file (phpunit.xml)", + }, + { + name: ["--extensions"], + description: "A comma separated list of PHPUnit extensions to load", + args: { + name: "extensions", + }, + }, + { + name: ["--no-extensions"], + description: "Do not load PHPUnit extensions", + }, + { + name: ["--include-path"], + description: "Prepend PHP's include_path with given path(s)", + args: { + name: "path(s)", + }, + }, + { + name: ["-d"], + description: "Sets a php.ini value", + args: { + name: "key[=value]", + }, + }, + { + name: ["--cache-result-file"], + description: "Specify result cache path and filename", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--generate-configuration"], + description: "Generate configuration file with suggested settings", + }, + { + name: ["--migrate-configuration"], + description: "Migrate configuration file to current format", + }, + ], - ], + }; export default completionSpec; - - From 2d0a6e9072db869ee5f4a80befe968ecc3e154d7 Mon Sep 17 00:00:00 2001 From: rubynguyen1510 <50710444+rubynguyen1510@users.noreply.github.com> Date: Fri, 9 Dec 2022 10:46:02 -0800 Subject: [PATCH 05/11] Update phpunit.ts --- src/phpunit.ts | 129 +------------------------------------------------ 1 file changed, 1 insertion(+), 128 deletions(-) diff --git a/src/phpunit.ts b/src/phpunit.ts index b855d6bfa1df..ee2730a586df 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -220,134 +220,7 @@ const completionSpec: Fig.Spec = { name: ["--migrate-configuration"], description: "Migrate configuration file to current format", }, - ], - - - + ], }; -const completionSpec: Fig.Spec = { - name: "phpunit", - description: "", - options: - [ - { - name: ["--log-junit"], - description: "Log test execution in JUnit XML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--log-teamcity"], - description: "Log test execution in TeamCity format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-html"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-text"], - description: "Write agile documentation in Text format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-xml"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--reverse-list"], - description: "Print defects in reverse order", - }, - { - name: ["--no-logging"], - description: "Ignore logging configuration", - }, - { - name: ["--prepend"], - description: "A PHP script that is included as early as possible", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--bootstrap"], - description: "A PHP script that is included before the tests run", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["-c", "--configuration"], - description: "Read configuration from XML file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--no-configuration"], - description: "Ignore default configuration file (phpunit.xml)", - }, - { - name: ["--extensions"], - description: "A comma separated list of PHPUnit extensions to load", - args: { - name: "extensions", - }, - }, - { - name: ["--no-extensions"], - description: "Do not load PHPUnit extensions", - }, - { - name: ["--include-path"], - description: "Prepend PHP's include_path with given path(s)", - args: { - name: "path(s)", - }, - }, - { - name: ["-d"], - description: "Sets a php.ini value", - args: { - name: "key[=value]", - }, - }, - { - name: ["--cache-result-file"], - description: "Specify result cache path and filename", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--generate-configuration"], - description: "Generate configuration file with suggested settings", - }, - { - name: ["--migrate-configuration"], - description: "Migrate configuration file to current format", - }, - ], -}; export default completionSpec; From 23524de48a5b0f7a09febd2438259011d8f281f3 Mon Sep 17 00:00:00 2001 From: Miguel Lopez <92610991+SimplyMiguel@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:08:39 -0800 Subject: [PATCH 06/11] Fixed the arguments so that theyre of the same syntax. --- phpunit.ts | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 phpunit.ts diff --git a/phpunit.ts b/phpunit.ts new file mode 100644 index 000000000000..4cf7a7154702 --- /dev/null +++ b/phpunit.ts @@ -0,0 +1,226 @@ +const completionSpec: Fig.Spec = { + name: "phpunit", + description: + "The PHPUnit is a command-line test runner that can be invoked through the phpunit command", + options: [ + { + name: ["--coverage-clover"], + description: "Generate code coverage report in Clover XML format,", + args: { + name: "file", + template: "filepaths" + }, + }, + { + name: ["--coverage-crap4j"], + description: "Generate code coverage report in Crap4J XML format", + args: { + name: "file", + template: "filepaths" + }, + }, + { + name: ["--coverage-html"], + description: "Generate code coverage report in HTML format", + }, + { + name: ["--coverage-php"], + description: "Export PHP_CodeCoverage object to file", + args: { + name: "file", + template: "filepaths" + }, + }, + { + name: ["--coverage-text="], + description: "Generate code coverage report in text format [default: standard output]", + args: { + name: "file", + template: "filepaths" + }, + }, + { + name: ["--coverage-xml"], + description: "Generate code coverage report in PHPUnit XML format", + }, + { + name: ["--coverage-cache"], + description: "Cache static analysis results", + }, + { + name: ["--warm-coverage-cache"], + description: "Warm static analysis cache", + }, + { + name: ["--coverage-filter"], + description: "Include in code coverage analysis", + }, + + { + name: ["--path-coverage"], + description: "Perform path coverage analysis", + }, + + { + name: ["--disable-coverage-ignore"], + description: "Disable annotations for ignoring code coverage", + }, + + { + name: ["--no-coverage"], + description: "Ignore code coverage configuration", + }, + { + name: ["--dont-report-useless-tests"], + description: "Do not report tests that do not test anything", + }, + + { + name: ["--strict-coverage"], + description: "Be strict about @covers annotation usage", + }, + { + name: ["--strict-global-state"], + description: "Be strict about changes to global state", + }, + { + name: ["--disallow-test-output"], + description: "Be strict about output during tests", + }, + { + name: ["--disallow-resource-usage"], + description: "Be strict about resource usage during small tests", + }, + { + name: ["--enforce-time-limit"], + description: "Enforce time limit based on test size", + }, + { + name: ["--default-time-limit"], + description: "Timeout in seconds for tests without @small, @medium or @large", + }, + { + name: ["--disallow-todo-tests"], + description: "Disallow @todo-annotated tests", + }, + { + name: ["--log-junit"], + description: "Log test execution in JUnit XML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--log-teamcity"], + description: "Log test execution in TeamCity format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-html"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-text"], + description: "Write agile documentation in Text format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--testdox-xml"], + description: "Write agile documentation in HTML format to file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--reverse-list"], + description: "Print defects in reverse order", + }, + { + name: ["--no-logging"], + description: "Ignore logging configuration", + }, + { + name: ["--prepend"], + description: "A PHP script that is included as early as possible", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--bootstrap"], + description: "A PHP script that is included before the tests run", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["-c", "--configuration"], + description: "Read configuration from XML file", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--no-configuration"], + description: "Ignore default configuration file (phpunit.xml)", + }, + { + name: ["--extensions"], + description: "A comma separated list of PHPUnit extensions to load", + args: { + name: "extensions", + }, + }, + { + name: ["--no-extensions"], + description: "Do not load PHPUnit extensions", + }, + { + name: ["--include-path"], + description: "Prepend PHP's include_path with given path(s)", + args: { + name: "path(s)", + }, + }, + { + name: ["-d"], + description: "Sets a php.ini value", + args: { + name: "key[=value]", + }, + }, + { + name: ["--cache-result-file"], + description: "Specify result cache path and filename", + args: { + name: "file", + template: "filepaths", + }, + }, + { + name: ["--generate-configuration"], + description: "Generate configuration file with suggested settings", + }, + { + name: ["--migrate-configuration"], + description: "Migrate configuration file to current format", + }, + ], +}; + +export default completionSpec; \ No newline at end of file From 18d45274e1160d412375d1df699f8cddd40486fd Mon Sep 17 00:00:00 2001 From: Miguel Lopez <92610991+SimplyMiguel@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:14:08 -0800 Subject: [PATCH 07/11] Added the arguments to the completion specs --- phpunit.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/phpunit.ts b/phpunit.ts index 4cf7a7154702..9a4394b6a591 100644 --- a/phpunit.ts +++ b/phpunit.ts @@ -22,6 +22,10 @@ const completionSpec: Fig.Spec = { { name: ["--coverage-html"], description: "Generate code coverage report in HTML format", + args: { + name: "dir", + template: "filepaths" + } }, { name: ["--coverage-php"], @@ -42,10 +46,18 @@ const completionSpec: Fig.Spec = { { name: ["--coverage-xml"], description: "Generate code coverage report in PHPUnit XML format", + args: { + name: "dir", + template: "filepaths" + } }, { name: ["--coverage-cache"], description: "Cache static analysis results", + args: { + name: "dir", + template: "filepaths" + } }, { name: ["--warm-coverage-cache"], @@ -54,6 +66,10 @@ const completionSpec: Fig.Spec = { { name: ["--coverage-filter"], description: "Include in code coverage analysis", + args: { + name: "dir", + template: "filepaths" + } }, { @@ -98,6 +114,9 @@ const completionSpec: Fig.Spec = { { name: ["--default-time-limit"], description: "Timeout in seconds for tests without @small, @medium or @large", + args: { + name: "seconds" + } }, { name: ["--disallow-todo-tests"], From 7c372d94392f333864a41967007d8ae962a043e1 Mon Sep 17 00:00:00 2001 From: Miguel Lopez <92610991+SimplyMiguel@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:17:07 -0800 Subject: [PATCH 08/11] Add files via upload From 9cd8bae1d2734418192cfab16eec2792720c58c4 Mon Sep 17 00:00:00 2001 From: Miguel Lopez <92610991+SimplyMiguel@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:18:21 -0800 Subject: [PATCH 09/11] Update phpunit.ts --- src/phpunit.ts | 260 +++++++++++++++---------------------------------- 1 file changed, 76 insertions(+), 184 deletions(-) diff --git a/src/phpunit.ts b/src/phpunit.ts index b855d6bfa1df..df00d5f1a327 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -1,236 +1,127 @@ -// Code Coverage Options: -const coverageCloverOption: Fig.Option = { - name: ["--coverage-clover"], - description: "Generate code coverage report in Clover XML format," -}; - -const coverageCrap4jOption: Fig.Option = { - name: ["--coverage-crap4j"], - description: "Generate code coverage report in Crap4J XML format", -}; - -const coverageHtmlOption: Fig.Option = { - name: ["--coverage-html"], - description: "Generate code coverage report in HTML format", -}; - -const coveragePhpOption: Fig.Option = { - name: ["--coverage-php"], - description: "Export PHP_CodeCoverage object to file", -}; - -const coverageTextOption: Fig.Option = { - name: ["--coverage-text="], - description: - " Generate code coverage report in text format [default: standard output]", -}; - -const coverageXmlOption: Fig.Option = { - name: ["--coverage-xml"], - description: "Generate code coverage report in PHPUnit XML format", -}; - -const coverageCacheOption: Fig.Option = { - name: ["--coverage-cache"], - description: "Cache static analysis results", -}; - -const warmCoverageCacheOption: Fig.Option = { - name: ["--warm-coverage-cache"], - description: "Warm static analysis cache", -}; - -const coverageFilterOption: Fig.Option = { - name: ["--coverage-filter"], - description: "Include in code coverage analysis", -}; - -const pathCoverageOption: Fig.Option = { - name: ["--path-coverage"], - description: "Perform path coverage analysis", -}; - -const disableCoverageIgnoreOption: Fig.Option = { - name: ["--disable-coverage-ignore"], - description: "Disable annotations for ignoring code coverage", -}; - -const noCoverageOption: Fig.Option = { - name: ["--no-coverage"], - description: "Ignore code coverage configuration", -}; - - -// Test Execution Options: - -const dontReportUselessTestsOption: Fig.Option = { - name: ["--dont-report-useless-tests"], - description: "Do not report tests that do not test anything", -}; - -const strictCoverageOption: Fig.Option = { - name: ["--strict-coverage"], - description: "Be strict about @covers annotation usage", -}; - -const strictGlobalStateOption: Fig.Option = { - name: ["--strict-global-state"], - description: "Be strict about changes to global state", -}; - - const completionSpec: Fig.Spec = { name: "phpunit", description: "The PHPUnit is a command-line test runner that can be invoked through the phpunit command", options: [ - - // Code Coverage Options: - coverageCloverOption, - coverageCrap4jOption, - coverageHtmlOption, - coveragePhpOption, - coverageTextOption, - coverageXmlOption, - coverageCacheOption, - warmCoverageCacheOption, - coverageFilterOption, - pathCoverageOption, - disableCoverageIgnoreOption, - noCoverageOption, - - // Test Execution Option: - dontReportUselessTestsOption, - strictCoverageOption, - strictGlobalStateOption, - { - name: ["--log-junit"], - description: "Log test execution in JUnit XML format to file", + { + name: ["--coverage-clover"], + description: "Generate code coverage report in Clover XML format,", args: { name: "file", - template: "filepaths", + template: "filepaths" }, }, { - name: ["--log-teamcity"], - description: "Log test execution in TeamCity format to file", + name: ["--coverage-crap4j"], + description: "Generate code coverage report in Crap4J XML format", args: { name: "file", - template: "filepaths", + template: "filepaths" }, }, { - name: ["--testdox-html"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, + name: ["--coverage-html"], + description: "Generate code coverage report in HTML format", + args: { + name: "dir", + template: "filepaths" + } }, { - name: ["--testdox-text"], - description: "Write agile documentation in Text format to file", - args: { + name: ["--coverage-php"], + description: "Export PHP_CodeCoverage object to file", + args: { name: "file", - template: "filepaths", + template: "filepaths" }, }, { - name: ["--testdox-xml"], - description: "Write agile documentation in HTML format to file", - args: { + name: ["--coverage-text="], + description: "Generate code coverage report in text format [default: standard output]", + args: { name: "file", - template: "filepaths", + template: "filepaths" }, }, { - name: ["--reverse-list"], - description: "Print defects in reverse order", + name: ["--coverage-xml"], + description: "Generate code coverage report in PHPUnit XML format", + args: { + name: "dir", + template: "filepaths" + } }, { - name: ["--no-logging"], - description: "Ignore logging configuration", + name: ["--coverage-cache"], + description: "Cache static analysis results", + args: { + name: "dir", + template: "filepaths" + } }, { - name: ["--prepend"], - description: "A PHP script that is included as early as possible", - args: { - name: "file", - template: "filepaths", - }, + name: ["--warm-coverage-cache"], + description: "Warm static analysis cache", }, { - name: ["--bootstrap"], - description: "A PHP script that is included before the tests run", - args: { - name: "file", - template: "filepaths", - }, + name: ["--coverage-filter"], + description: "Include in code coverage analysis", + args: { + name: "dir", + template: "filepaths" + } }, + { - name: ["-c", "--configuration"], - description: "Read configuration from XML file", - args: { - name: "file", - template: "filepaths", - }, + name: ["--path-coverage"], + description: "Perform path coverage analysis", }, + { - name: ["--no-configuration"], - description: "Ignore default configuration file (phpunit.xml)", + name: ["--disable-coverage-ignore"], + description: "Disable annotations for ignoring code coverage", }, + { - name: ["--extensions"], - description: "A comma separated list of PHPUnit extensions to load", - args: { - name: "extensions", - }, + name: ["--no-coverage"], + description: "Ignore code coverage configuration", }, { - name: ["--no-extensions"], - description: "Do not load PHPUnit extensions", + name: ["--dont-report-useless-tests"], + description: "Do not report tests that do not test anything", + }, + + { + name: ["--strict-coverage"], + description: "Be strict about @covers annotation usage", }, { - name: ["--include-path"], - description: "Prepend PHP's include_path with given path(s)", - args: { - name: "path(s)", - }, + name: ["--strict-global-state"], + description: "Be strict about changes to global state", }, { - name: ["-d"], - description: "Sets a php.ini value", - args: { - name: "key[=value]", - }, + name: ["--disallow-test-output"], + description: "Be strict about output during tests", }, { - name: ["--cache-result-file"], - description: "Specify result cache path and filename", - args: { - name: "file", - template: "filepaths", - }, + name: ["--disallow-resource-usage"], + description: "Be strict about resource usage during small tests", }, { - name: ["--generate-configuration"], - description: "Generate configuration file with suggested settings", + name: ["--enforce-time-limit"], + description: "Enforce time limit based on test size", }, { - name: ["--migrate-configuration"], - description: "Migrate configuration file to current format", + name: ["--default-time-limit"], + description: "Timeout in seconds for tests without @small, @medium or @large", + args: { + name: "seconds" + } + }, + { + name: ["--disallow-todo-tests"], + description: "Disallow @todo-annotated tests", }, - ], - - - -}; - -const completionSpec: Fig.Spec = { - name: "phpunit", - description: "", - options: - [ { name: ["--log-junit"], description: "Log test execution in JUnit XML format to file", @@ -348,6 +239,7 @@ const completionSpec: Fig.Spec = { name: ["--migrate-configuration"], description: "Migrate configuration file to current format", }, - ], + ], }; + export default completionSpec; From 8113e086b0cf7caa7f484ae3dccf4e3b4dca2e77 Mon Sep 17 00:00:00 2001 From: rubynguyen1510 <50710444+rubynguyen1510@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:37:08 -0800 Subject: [PATCH 10/11] fix linter errors --- src/phpunit.ts | 74 +++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/phpunit.ts b/src/phpunit.ts index df00d5f1a327..11805bb77a88 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -4,7 +4,7 @@ const completionSpec: Fig.Spec = { "The PHPUnit is a command-line test runner that can be invoked through the phpunit command", options: [ { - name: ["--coverage-clover"], + name: "--coverage-clover", description: "Generate code coverage report in Clover XML format,", args: { name: "file", @@ -12,7 +12,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--coverage-crap4j"], + name: "--coverage-crap4j", description: "Generate code coverage report in Crap4J XML format", args: { name: "file", @@ -20,7 +20,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--coverage-html"], + name: "--coverage-html", description: "Generate code coverage report in HTML format", args: { name: "dir", @@ -28,7 +28,7 @@ const completionSpec: Fig.Spec = { } }, { - name: ["--coverage-php"], + name: "--coverage-php", description: "Export PHP_CodeCoverage object to file", args: { name: "file", @@ -36,7 +36,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--coverage-text="], + name: "--coverage-text=", description: "Generate code coverage report in text format [default: standard output]", args: { name: "file", @@ -44,7 +44,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--coverage-xml"], + name: "--coverage-xml", description: "Generate code coverage report in PHPUnit XML format", args: { name: "dir", @@ -52,7 +52,7 @@ const completionSpec: Fig.Spec = { } }, { - name: ["--coverage-cache"], + name: "--coverage-cache", description: "Cache static analysis results", args: { name: "dir", @@ -60,11 +60,11 @@ const completionSpec: Fig.Spec = { } }, { - name: ["--warm-coverage-cache"], + name: "--warm-coverage-cache", description: "Warm static analysis cache", }, { - name: ["--coverage-filter"], + name: "--coverage-filter", description: "Include in code coverage analysis", args: { name: "dir", @@ -73,57 +73,57 @@ const completionSpec: Fig.Spec = { }, { - name: ["--path-coverage"], + name: "--path-coverage", description: "Perform path coverage analysis", }, { - name: ["--disable-coverage-ignore"], + name: "--disable-coverage-ignore", description: "Disable annotations for ignoring code coverage", }, { - name: ["--no-coverage"], + name: "--no-coverage", description: "Ignore code coverage configuration", }, { - name: ["--dont-report-useless-tests"], + name: "--dont-report-useless-tests", description: "Do not report tests that do not test anything", }, { - name: ["--strict-coverage"], + name: "--strict-coverage", description: "Be strict about @covers annotation usage", }, { - name: ["--strict-global-state"], + name: "--strict-global-state", description: "Be strict about changes to global state", }, { - name: ["--disallow-test-output"], + name: "--disallow-test-output", description: "Be strict about output during tests", }, { - name: ["--disallow-resource-usage"], + name: "--disallow-resource-usage", description: "Be strict about resource usage during small tests", }, { - name: ["--enforce-time-limit"], + name: "--enforce-time-limit", description: "Enforce time limit based on test size", }, { - name: ["--default-time-limit"], + name: "--default-time-limit", description: "Timeout in seconds for tests without @small, @medium or @large", args: { name: "seconds" } }, { - name: ["--disallow-todo-tests"], + name: "--disallow-todo-tests", description: "Disallow @todo-annotated tests", }, { - name: ["--log-junit"], + name: "--log-junit", description: "Log test execution in JUnit XML format to file", args: { name: "file", @@ -131,7 +131,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--log-teamcity"], + name: "--log-teamcity", description: "Log test execution in TeamCity format to file", args: { name: "file", @@ -139,7 +139,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--testdox-html"], + name: "--testdox-html", description: "Write agile documentation in HTML format to file", args: { name: "file", @@ -147,7 +147,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--testdox-text"], + name: "--testdox-text", description: "Write agile documentation in Text format to file", args: { name: "file", @@ -155,7 +155,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--testdox-xml"], + name: "--testdox-xml", description: "Write agile documentation in HTML format to file", args: { name: "file", @@ -163,15 +163,15 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--reverse-list"], + name: "--reverse-list", description: "Print defects in reverse order", }, { - name: ["--no-logging"], + name: "--no-logging", description: "Ignore logging configuration", }, { - name: ["--prepend"], + name: "--prepend", description: "A PHP script that is included as early as possible", args: { name: "file", @@ -179,7 +179,7 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--bootstrap"], + name: "--bootstrap", description: "A PHP script that is included before the tests run", args: { name: "file", @@ -195,36 +195,36 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--no-configuration"], + name: "--no-configuration", description: "Ignore default configuration file (phpunit.xml)", }, { - name: ["--extensions"], + name: "--extensions", description: "A comma separated list of PHPUnit extensions to load", args: { name: "extensions", }, }, { - name: ["--no-extensions"], + name: "--no-extensions", description: "Do not load PHPUnit extensions", }, { - name: ["--include-path"], + name: "--include-path", description: "Prepend PHP's include_path with given path(s)", args: { name: "path(s)", }, }, { - name: ["-d"], + name: "-d", description: "Sets a php.ini value", args: { name: "key[=value]", }, }, { - name: ["--cache-result-file"], + name: "--cache-result-file", description: "Specify result cache path and filename", args: { name: "file", @@ -232,11 +232,11 @@ const completionSpec: Fig.Spec = { }, }, { - name: ["--generate-configuration"], + name: "--generate-configuration", description: "Generate configuration file with suggested settings", }, { - name: ["--migrate-configuration"], + name: "--migrate-configuration", description: "Migrate configuration file to current format", }, ], From 9d8e8de01aa666b6c2715ea24d2f83fcec9e68da Mon Sep 17 00:00:00 2001 From: rubynguyen1510 Date: Sun, 12 Feb 2023 08:18:21 -0800 Subject: [PATCH 11/11] Changes to be committed: deleted: phpunit.ts modified: src/phpunit.ts --- phpunit.ts | 245 ------------------------------------------------- src/phpunit.ts | 3 +- 2 files changed, 2 insertions(+), 246 deletions(-) delete mode 100644 phpunit.ts diff --git a/phpunit.ts b/phpunit.ts deleted file mode 100644 index 9a4394b6a591..000000000000 --- a/phpunit.ts +++ /dev/null @@ -1,245 +0,0 @@ -const completionSpec: Fig.Spec = { - name: "phpunit", - description: - "The PHPUnit is a command-line test runner that can be invoked through the phpunit command", - options: [ - { - name: ["--coverage-clover"], - description: "Generate code coverage report in Clover XML format,", - args: { - name: "file", - template: "filepaths" - }, - }, - { - name: ["--coverage-crap4j"], - description: "Generate code coverage report in Crap4J XML format", - args: { - name: "file", - template: "filepaths" - }, - }, - { - name: ["--coverage-html"], - description: "Generate code coverage report in HTML format", - args: { - name: "dir", - template: "filepaths" - } - }, - { - name: ["--coverage-php"], - description: "Export PHP_CodeCoverage object to file", - args: { - name: "file", - template: "filepaths" - }, - }, - { - name: ["--coverage-text="], - description: "Generate code coverage report in text format [default: standard output]", - args: { - name: "file", - template: "filepaths" - }, - }, - { - name: ["--coverage-xml"], - description: "Generate code coverage report in PHPUnit XML format", - args: { - name: "dir", - template: "filepaths" - } - }, - { - name: ["--coverage-cache"], - description: "Cache static analysis results", - args: { - name: "dir", - template: "filepaths" - } - }, - { - name: ["--warm-coverage-cache"], - description: "Warm static analysis cache", - }, - { - name: ["--coverage-filter"], - description: "Include in code coverage analysis", - args: { - name: "dir", - template: "filepaths" - } - }, - - { - name: ["--path-coverage"], - description: "Perform path coverage analysis", - }, - - { - name: ["--disable-coverage-ignore"], - description: "Disable annotations for ignoring code coverage", - }, - - { - name: ["--no-coverage"], - description: "Ignore code coverage configuration", - }, - { - name: ["--dont-report-useless-tests"], - description: "Do not report tests that do not test anything", - }, - - { - name: ["--strict-coverage"], - description: "Be strict about @covers annotation usage", - }, - { - name: ["--strict-global-state"], - description: "Be strict about changes to global state", - }, - { - name: ["--disallow-test-output"], - description: "Be strict about output during tests", - }, - { - name: ["--disallow-resource-usage"], - description: "Be strict about resource usage during small tests", - }, - { - name: ["--enforce-time-limit"], - description: "Enforce time limit based on test size", - }, - { - name: ["--default-time-limit"], - description: "Timeout in seconds for tests without @small, @medium or @large", - args: { - name: "seconds" - } - }, - { - name: ["--disallow-todo-tests"], - description: "Disallow @todo-annotated tests", - }, - { - name: ["--log-junit"], - description: "Log test execution in JUnit XML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--log-teamcity"], - description: "Log test execution in TeamCity format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-html"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-text"], - description: "Write agile documentation in Text format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--testdox-xml"], - description: "Write agile documentation in HTML format to file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--reverse-list"], - description: "Print defects in reverse order", - }, - { - name: ["--no-logging"], - description: "Ignore logging configuration", - }, - { - name: ["--prepend"], - description: "A PHP script that is included as early as possible", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--bootstrap"], - description: "A PHP script that is included before the tests run", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["-c", "--configuration"], - description: "Read configuration from XML file", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--no-configuration"], - description: "Ignore default configuration file (phpunit.xml)", - }, - { - name: ["--extensions"], - description: "A comma separated list of PHPUnit extensions to load", - args: { - name: "extensions", - }, - }, - { - name: ["--no-extensions"], - description: "Do not load PHPUnit extensions", - }, - { - name: ["--include-path"], - description: "Prepend PHP's include_path with given path(s)", - args: { - name: "path(s)", - }, - }, - { - name: ["-d"], - description: "Sets a php.ini value", - args: { - name: "key[=value]", - }, - }, - { - name: ["--cache-result-file"], - description: "Specify result cache path and filename", - args: { - name: "file", - template: "filepaths", - }, - }, - { - name: ["--generate-configuration"], - description: "Generate configuration file with suggested settings", - }, - { - name: ["--migrate-configuration"], - description: "Migrate configuration file to current format", - }, - ], -}; - -export default completionSpec; \ No newline at end of file diff --git a/src/phpunit.ts b/src/phpunit.ts index 11805bb77a88..ef2ebdaf9dd0 100644 --- a/src/phpunit.ts +++ b/src/phpunit.ts @@ -36,7 +36,8 @@ const completionSpec: Fig.Spec = { }, }, { - name: "--coverage-text=", + name: "--coverage-text", + requiresSeparator: true, description: "Generate code coverage report in text format [default: standard output]", args: { name: "file",