|
| 1 | +Feature: Composer authentication for various git providers |
| 2 | + |
| 3 | + Scenario: GitHub OAuth token is set in COMPOSER_AUTH |
| 4 | + Given an empty directory |
| 5 | + When I run `GITHUB_TOKEN=ghp_test123456789 wp package path` |
| 6 | + Then STDOUT should not be empty |
| 7 | + And the return code should be 0 |
| 8 | + |
| 9 | + Scenario: GitLab OAuth token is set in COMPOSER_AUTH |
| 10 | + Given an empty directory |
| 11 | + When I run `GITLAB_OAUTH_TOKEN=glpat_test123456789 wp package path` |
| 12 | + Then STDOUT should not be empty |
| 13 | + And the return code should be 0 |
| 14 | + |
| 15 | + Scenario: GitLab personal access token is set in COMPOSER_AUTH |
| 16 | + Given an empty directory |
| 17 | + When I run `GITLAB_TOKEN=glpat_test123456789 wp package path` |
| 18 | + Then STDOUT should not be empty |
| 19 | + And the return code should be 0 |
| 20 | + |
| 21 | + Scenario: Bitbucket OAuth consumer is set in COMPOSER_AUTH |
| 22 | + Given an empty directory |
| 23 | + When I run `BITBUCKET_CONSUMER_KEY=test_key BITBUCKET_CONSUMER_SECRET=test_secret wp package path` |
| 24 | + Then STDOUT should not be empty |
| 25 | + And the return code should be 0 |
| 26 | + |
| 27 | + Scenario: HTTP Basic Auth is set in COMPOSER_AUTH |
| 28 | + Given an empty directory |
| 29 | + When I run `HTTP_BASIC_AUTH='{"repo.example.com":{"username":"user","password":"pass"}}' wp package path` |
| 30 | + Then STDOUT should not be empty |
| 31 | + And the return code should be 0 |
| 32 | + |
| 33 | + Scenario: Multiple auth providers can be used together |
| 34 | + Given an empty directory |
| 35 | + When I run `GITHUB_TOKEN=ghp_test123 GITLAB_TOKEN=glpat_test456 wp package path` |
| 36 | + Then STDOUT should not be empty |
| 37 | + And the return code should be 0 |
| 38 | + |
| 39 | + Scenario: Invalid HTTP_BASIC_AUTH JSON is ignored |
| 40 | + Given an empty directory |
| 41 | + When I run `HTTP_BASIC_AUTH='not-valid-json' wp package path` |
| 42 | + Then STDOUT should not be empty |
| 43 | + And the return code should be 0 |
0 commit comments