summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/expected/php/composer/v1.0.json335
-rw-r--r--spec/fixtures/expected/php/composer/v1.1.json485
-rw-r--r--spec/fixtures/expected/php/composer/v2.0.json291
-rw-r--r--spec/fixtures/expected/php/composer/v2.1.json289
-rw-r--r--spec/fixtures/haproxy.cfg6
-rw-r--r--spec/fixtures/php/composer/custom-tls/composer.json12
-rw-r--r--spec/fixtures/php/composer/dev-dependencies/composer.json8
-rw-r--r--spec/fixtures/php/composer/drupal/composer.json (renamed from spec/fixtures/php/drupal-composer/composer.json)0
-rw-r--r--spec/fixtures/php/composer/drupal/composer.lock (renamed from spec/fixtures/php/drupal-composer/composer.lock)0
-rw-r--r--spec/integration/php/composer_spec.rb92
-rw-r--r--spec/support/proxy_helper.rb2
11 files changed, 122 insertions, 1398 deletions
diff --git a/spec/fixtures/expected/php/composer/v1.0.json b/spec/fixtures/expected/php/composer/v1.0.json
index 6b9833d..4155e77 100644
--- a/spec/fixtures/expected/php/composer/v1.0.json
+++ b/spec/fixtures/expected/php/composer/v1.0.json
@@ -1,16 +1,16 @@
{
"licenses": [
{
- "count": 36,
+ "count": 28,
"name": "MIT"
},
{
- "count": 18,
- "name": "New BSD"
+ "count": 1,
+ "name": "BSD-3-Clause-Attribution"
},
{
"count": 1,
- "name": "BSD-3-Clause-Attribution"
+ "name": "New BSD"
},
{
"count": 1,
@@ -59,19 +59,6 @@
},
{
"license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "doctrine/instantiator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
"name": "Simplified BSD",
"url": "http://opensource.org/licenses/bsd-license"
},
@@ -167,19 +154,6 @@
"url": "http://opensource.org/licenses/mit-license"
},
"dependency": {
- "name": "myclabs/deep-copy",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
"name": "nesbot/carbon",
"description": "",
"pathes": [
@@ -219,149 +193,6 @@
"url": "http://opensource.org/licenses/mit-license"
},
"dependency": {
- "name": "phpdocumentor/reflection-common",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "phpdocumentor/reflection-docblock",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "phpdocumentor/type-resolver",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "phpspec/prophecy",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-code-coverage",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-file-iterator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-text-template",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-timer",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-token-stream",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/phpunit",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/phpunit-mock-objects",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
"name": "psr/log",
"description": "",
"pathes": [
@@ -397,136 +228,6 @@
},
{
"license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/code-unit-reverse-lookup",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/comparator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/diff",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/environment",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/exporter",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/global-state",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/object-enumerator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/recursion-context",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/resource-operations",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/version",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
"name": "MIT",
"url": "http://opensource.org/licenses/mit-license"
},
@@ -709,19 +410,6 @@
},
{
"license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "symfony/yaml",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "license": {
"name": "BSD-3-Clause-Attribution"
},
"dependency": {
@@ -731,19 +419,6 @@
"."
]
}
- },
- {
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "webmozart/assert",
- "description": "",
- "pathes": [
- "."
- ]
- }
}
]
-}
+} \ No newline at end of file
diff --git a/spec/fixtures/expected/php/composer/v1.1.json b/spec/fixtures/expected/php/composer/v1.1.json
index 8aa7f32..73be785 100644
--- a/spec/fixtures/expected/php/composer/v1.1.json
+++ b/spec/fixtures/expected/php/composer/v1.1.json
@@ -2,16 +2,16 @@
"version": "1.1",
"licenses": [
{
- "count": 36,
+ "count": 28,
"name": "MIT"
},
{
- "count": 18,
- "name": "New BSD"
+ "count": 1,
+ "name": "BSD-3-Clause-Attribution"
},
{
"count": 1,
- "name": "BSD-3-Clause-Attribution"
+ "name": "New BSD"
},
{
"count": 1,
@@ -79,25 +79,6 @@
{
"licenses": [
{
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "doctrine/instantiator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
"name": "Simplified BSD",
"url": "http://opensource.org/licenses/bsd-license"
}
@@ -240,25 +221,6 @@
"url": "http://opensource.org/licenses/mit-license"
},
"dependency": {
- "name": "myclabs/deep-copy",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
"name": "nesbot/carbon",
"description": "",
"pathes": [
@@ -316,215 +278,6 @@
"url": "http://opensource.org/licenses/mit-license"
},
"dependency": {
- "name": "phpdocumentor/reflection-common",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "phpdocumentor/reflection-docblock",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "phpdocumentor/type-resolver",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "phpspec/prophecy",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-code-coverage",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-file-iterator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-text-template",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-timer",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/php-token-stream",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/phpunit",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "phpunit/phpunit-mock-objects",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
"name": "psr/log",
"description": "",
"pathes": [
@@ -573,196 +326,6 @@
{
"licenses": [
{
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/code-unit-reverse-lookup",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/comparator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/diff",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/environment",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/exporter",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/global-state",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/object-enumerator",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/recursion-context",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/resource-operations",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "license": {
- "name": "New BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- },
- "dependency": {
- "name": "sebastian/version",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
"name": "MIT",
"url": "http://opensource.org/licenses/mit-license"
}
@@ -1029,25 +592,6 @@
{
"licenses": [
{
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "symfony/yaml",
- "description": "",
- "pathes": [
- "."
- ]
- }
- },
- {
- "licenses": [
- {
"name": "BSD-3-Clause-Attribution",
"url": ""
}
@@ -1062,25 +606,6 @@
"."
]
}
- },
- {
- "licenses": [
- {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- }
- ],
- "license": {
- "name": "MIT",
- "url": "http://opensource.org/licenses/mit-license"
- },
- "dependency": {
- "name": "webmozart/assert",
- "description": "",
- "pathes": [
- "."
- ]
- }
}
]
-}
+} \ No newline at end of file
diff --git a/spec/fixtures/expected/php/composer/v2.0.json b/spec/fixtures/expected/php/composer/v2.0.json
index c0e0982..a01b14b 100644
--- a/spec/fixtures/expected/php/composer/v2.0.json
+++ b/spec/fixtures/expected/php/composer/v2.0.json
@@ -5,13 +5,7 @@
"id": "MIT",
"name": "MIT License",
"url": "https://opensource.org/licenses/MIT",
- "count": 36
- },
- {
- "id": "BSD-3-Clause",
- "name": "BSD 3-Clause \"New\" or \"Revised\" License",
- "url": "https://opensource.org/licenses/BSD-3-Clause",
- "count": 18
+ "count": 28
},
{
"id": "BSD-2-Clause",
@@ -20,6 +14,12 @@
"count": 1
},
{
+ "id": "BSD-3-Clause",
+ "name": "BSD 3-Clause \"New\" or \"Revised\" License",
+ "url": "https://opensource.org/licenses/BSD-3-Clause",
+ "count": 1
+ },
+ {
"id": "BSD-3-Clause-Attribution",
"name": "BSD with attribution",
"url": "https://fedoraproject.org/wiki/Licensing/BSD_with_Attribution",
@@ -61,17 +61,6 @@
]
},
{
- "name": "doctrine/instantiator",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
"name": "jakub-onderka/php-console-color",
"url": "",
"description": "",
@@ -149,17 +138,6 @@
]
},
{
- "name": "myclabs/deep-copy",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
"name": "nesbot/carbon",
"url": "",
"description": "",
@@ -193,127 +171,6 @@
]
},
{
- "name": "phpdocumentor/reflection-common",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpdocumentor/reflection-docblock",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpdocumentor/type-resolver",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpspec/prophecy",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpunit/php-code-coverage",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-file-iterator",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-text-template",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-timer",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-token-stream",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/phpunit",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/phpunit-mock-objects",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
"name": "psr/log",
"url": "",
"description": "",
@@ -347,116 +204,6 @@
]
},
{
- "name": "sebastian/code-unit-reverse-lookup",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/comparator",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/diff",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/environment",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/exporter",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/global-state",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/object-enumerator",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/recursion-context",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/resource-operations",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/version",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
"name": "swiftmailer/swiftmailer",
"url": "",
"description": "",
@@ -611,17 +358,6 @@
]
},
{
- "name": "symfony/yaml",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
- },
- {
"name": "vlucas/phpdotenv",
"url": "",
"description": "",
@@ -631,17 +367,6 @@
"licenses": [
"BSD-3-Clause-Attribution"
]
- },
- {
- "name": "webmozart/assert",
- "url": "",
- "description": "",
- "paths": [
- "."
- ],
- "licenses": [
- "MIT"
- ]
}
]
-}
+} \ No newline at end of file
diff --git a/spec/fixtures/expected/php/composer/v2.1.json b/spec/fixtures/expected/php/composer/v2.1.json
index b780e2f..a5c3fec 100644
--- a/spec/fixtures/expected/php/composer/v2.1.json
+++ b/spec/fixtures/expected/php/composer/v2.1.json
@@ -27,7 +27,7 @@
"name": "classpreloader/classpreloader",
"version": "3.2.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -36,7 +36,7 @@
"name": "dnoegel/php-xdg-base-dir",
"version": "0.1",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -45,16 +45,7 @@
"name": "doctrine/inflector",
"version": "v1.1.0",
"package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "doctrine/instantiator",
- "version": "1.0.5",
- "package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -63,7 +54,7 @@
"name": "jakub-onderka/php-console-color",
"version": "0.1",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"BSD-2-Clause"
]
@@ -72,7 +63,7 @@
"name": "jakub-onderka/php-console-highlighter",
"version": "v0.3.2",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -81,7 +72,7 @@
"name": "jeremeamia/SuperClosure",
"version": "2.3.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -90,7 +81,7 @@
"name": "laravel/framework",
"version": "v5.3.31",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -99,7 +90,7 @@
"name": "league/flysystem",
"version": "1.0.42",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -108,7 +99,7 @@
"name": "monolog/monolog",
"version": "1.23.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -117,16 +108,7 @@
"name": "mtdowling/cron-expression",
"version": "v1.2.1",
"package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "myclabs/deep-copy",
- "version": "1.7.0",
- "package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -135,7 +117,7 @@
"name": "nesbot/carbon",
"version": "1.22.1",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -144,7 +126,7 @@
"name": "nikic/php-parser",
"version": "v3.1.4",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"BSD-3-Clause"
]
@@ -153,115 +135,16 @@
"name": "paragonie/random_compat",
"version": "v2.0.11",
"package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpdocumentor/reflection-common",
- "version": "1.0.1",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpdocumentor/reflection-docblock",
- "version": "3.3.2",
- "package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
},
{
- "name": "phpdocumentor/type-resolver",
- "version": "0.4.0",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpspec/prophecy",
- "version": "1.7.4",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "phpunit/php-code-coverage",
- "version": "4.0.8",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-file-iterator",
- "version": "1.4.5",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-text-template",
- "version": "1.2.1",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-timer",
- "version": "1.0.9",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/php-token-stream",
- "version": "1.4.12",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/phpunit",
- "version": "5.7.27",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "phpunit/phpunit-mock-objects",
- "version": "3.4.4",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
"name": "psr/log",
"version": "1.0.2",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -270,7 +153,7 @@
"name": "psy/psysh",
"version": "v0.8.17",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -279,106 +162,16 @@
"name": "ramsey/uuid",
"version": "3.7.3",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
},
{
- "name": "sebastian/code-unit-reverse-lookup",
- "version": "1.0.1",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/comparator",
- "version": "1.2.4",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/diff",
- "version": "1.4.3",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/environment",
- "version": "2.0.0",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/exporter",
- "version": "2.0.0",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/global-state",
- "version": "1.1.1",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/object-enumerator",
- "version": "2.0.1",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/recursion-context",
- "version": "2.0.0",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/resource-operations",
- "version": "1.0.0",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
- "name": "sebastian/version",
- "version": "2.0.1",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "BSD-3-Clause"
- ]
- },
- {
"name": "swiftmailer/swiftmailer",
"version": "v5.4.9",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -387,7 +180,7 @@
"name": "symfony/console",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -396,7 +189,7 @@
"name": "symfony/debug",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -405,7 +198,7 @@
"name": "symfony/event-dispatcher",
"version": "v3.4.4",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -414,7 +207,7 @@
"name": "symfony/finder",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -423,7 +216,7 @@
"name": "symfony/http-foundation",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -432,7 +225,7 @@
"name": "symfony/http-kernel",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -441,7 +234,7 @@
"name": "symfony/polyfill-mbstring",
"version": "v1.7.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -450,7 +243,7 @@
"name": "symfony/polyfill-php56",
"version": "v1.7.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -459,7 +252,7 @@
"name": "symfony/polyfill-util",
"version": "v1.7.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -468,7 +261,7 @@
"name": "symfony/process",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -477,7 +270,7 @@
"name": "symfony/routing",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -486,7 +279,7 @@
"name": "symfony/translation",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -495,16 +288,7 @@
"name": "symfony/var-dumper",
"version": "v3.1.10",
"package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
- },
- {
- "name": "symfony/yaml",
- "version": "v3.3.16",
- "package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"MIT"
]
@@ -513,19 +297,10 @@
"name": "vlucas/phpdotenv",
"version": "v2.4.0",
"package_manager": "composer",
- "path": ".",
+ "path": "composer.lock",
"licenses": [
"BSD-3-Clause-Attribution"
]
- },
- {
- "name": "webmozart/assert",
- "version": "1.3.0",
- "package_manager": "composer",
- "path": ".",
- "licenses": [
- "MIT"
- ]
}
]
-}
+} \ No newline at end of file
diff --git a/spec/fixtures/haproxy.cfg b/spec/fixtures/haproxy.cfg
index b0ab370..4a5b982 100644
--- a/spec/fixtures/haproxy.cfg
+++ b/spec/fixtures/haproxy.cfg
@@ -20,6 +20,7 @@ defaults
frontend www-https
bind *:443 ssl crt wildcard.test.pem
+ acl composer-backend ssl_fc_sni composer.test
acl goproxy-backend ssl_fc_sni goproxy.test
acl maven-backend ssl_fc_sni maven.test
acl npm-backend ssl_fc_sni npm.test
@@ -28,12 +29,14 @@ frontend www-https
acl rubygems-backend ssl_fc_sni rubygems.test
http-request replace-header Host .* api.nuget.org if nuget-backend
+ http-request replace-header Host .* packagist.org if composer-backend
http-request replace-header Host .* proxy.golang.org if goproxy-backend
http-request replace-header Host .* pypi.org if pypi-backend
http-request replace-header Host .* registry.npmjs.org if npm-backend
http-request replace-header Host .* repo1.maven.org if maven-backend
http-request replace-header Host .* rubygems.org if rubygems-backend
+ use_backend composer-backend if composer-backend
use_backend goproxy-backend if goproxy-backend
use_backend maven-backend if maven-backend
use_backend npm-backend if npm-backend
@@ -41,6 +44,9 @@ frontend www-https
use_backend pypi-backend if pypi-backend
use_backend rubygems-backend if rubygems-backend
+backend composer-backend
+ server www1 packagist.org:443 ssl verify none
+
backend goproxy-backend
server www1 proxy.golang.org:443 ssl verify none
diff --git a/spec/fixtures/php/composer/custom-tls/composer.json b/spec/fixtures/php/composer/custom-tls/composer.json
new file mode 100644
index 0000000..e70b1d2
--- /dev/null
+++ b/spec/fixtures/php/composer/custom-tls/composer.json
@@ -0,0 +1,12 @@
+{
+ "repositories": [
+ { "packagist.org": false },
+ {
+ "type": "composer",
+ "url": "https://composer.test"
+ }
+ ],
+ "require": {
+ "monolog/monolog": "1.0.*"
+ }
+}
diff --git a/spec/fixtures/php/composer/dev-dependencies/composer.json b/spec/fixtures/php/composer/dev-dependencies/composer.json
new file mode 100644
index 0000000..c959c23
--- /dev/null
+++ b/spec/fixtures/php/composer/dev-dependencies/composer.json
@@ -0,0 +1,8 @@
+{
+ "require": {
+ "monolog/monolog": "1.0.*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "9.0.*"
+ }
+}
diff --git a/spec/fixtures/php/drupal-composer/composer.json b/spec/fixtures/php/composer/drupal/composer.json
index 48b445b..48b445b 100644
--- a/spec/fixtures/php/drupal-composer/composer.json
+++ b/spec/fixtures/php/composer/drupal/composer.json
diff --git a/spec/fixtures/php/drupal-composer/composer.lock b/spec/fixtures/php/composer/drupal/composer.lock
index 31358d5..31358d5 100644
--- a/spec/fixtures/php/drupal-composer/composer.lock
+++ b/spec/fixtures/php/composer/drupal/composer.lock
diff --git a/spec/integration/php/composer_spec.rb b/spec/integration/php/composer_spec.rb
index 11ebdce..0fb09ee 100644
--- a/spec/integration/php/composer_spec.rb
+++ b/spec/integration/php/composer_spec.rb
@@ -1,13 +1,19 @@
require 'spec_helper'
RSpec.describe "composer" do
+ subject { runner.scan(env: env) }
+
+ let(:env) { {} }
+
+ before do
+ system("rm -rf /opt/asdf/installs/php/**/.composer")
+ end
+
include_examples "each report version", "php", "composer"
context "when the project's dependencies require php-gd e.g. in the case of Drupal" do
- subject { runner.scan }
-
before do
- runner.mount(dir: fixture_file('php/drupal-composer'))
+ runner.mount(dir: fixture_file('php/composer/drupal'))
end
it 'installs the required dependencies and produces a valid report' do
@@ -16,10 +22,6 @@ RSpec.describe "composer" do
expect(subject[:licenses]).not_to be_empty
expect(subject.dependency_names).to match_array(%w[
asm89/stack-cors
- behat/mink
- behat/mink-browserkit-driver
- behat/mink-goutte-driver
- behat/mink-selenium2-driver
brumann/polyfill-unserialize
composer/semver
doctrine/annotations
@@ -28,71 +30,33 @@ RSpec.describe "composer" do
doctrine/common
doctrine/event-manager
doctrine/inflector
- doctrine/instantiator
doctrine/lexer
doctrine/persistence
doctrine/reflection
- drupal/coder
easyrdf/easyrdf
egulias/email-validator
- fabpot/goutte
guzzlehttp/guzzle
guzzlehttp/promises
guzzlehttp/psr7
- instaclick/php-webdriver
- jcalderonzumba/gastonjs
- jcalderonzumba/mink-phantomjs-driver
- justinrainbow/json-schema
masterminds/html5
- mikey179/vfsstream
- myclabs/deep-copy
paragonie/random_compat
pear/archive_tar
pear/console_getopt
pear/pear-core-minimal
pear/pear_exception
- phar-io/manifest
- phar-io/version
- phpdocumentor/reflection-common
- phpdocumentor/reflection-docblock
- phpdocumentor/type-resolver
- phpspec/prophecy
- phpunit/php-code-coverage
- phpunit/php-file-iterator
- phpunit/php-text-template
- phpunit/php-timer
- phpunit/php-token-stream
- phpunit/phpunit
- phpunit/phpunit-mock-objects
psr/container
psr/http-message
psr/log
ralouphie/getallheaders
- sebastian/code-unit-reverse-lookup
- sebastian/comparator
- sebastian/diff
- sebastian/environment
- sebastian/exporter
- sebastian/global-state
- sebastian/object-enumerator
- sebastian/object-reflector
- sebastian/recursion-context
- sebastian/resource-operations
- sebastian/version
- squizlabs/php_codesniffer
stack/builder
symfony-cmf/routing
- symfony/browser-kit
symfony/class-loader
symfony/console
- symfony/css-selector
symfony/debug
symfony/dependency-injection
- symfony/dom-crawler
symfony/event-dispatcher
symfony/http-foundation
symfony/http-kernel
- symfony/phpunit-bridge
symfony/polyfill-ctype
symfony/polyfill-iconv
symfony/polyfill-intl-idn
@@ -109,10 +73,8 @@ RSpec.describe "composer" do
symfony/translation
symfony/validator
symfony/yaml
- theseer/tokenizer
twig/twig
typo3/phar-stream-wrapper
- webmozart/assert
zendframework/zend-diactoros
zendframework/zend-escaper
zendframework/zend-feed
@@ -120,4 +82,40 @@ RSpec.describe "composer" do
])
end
end
+
+ context "when fetching dependencies from a custom registry" do
+ before do
+ add_host('composer.test', '127.0.0.1')
+ start_proxy_server
+ runner.mount(dir: fixture_file('php/composer/custom-tls'))
+ end
+
+ context "when the CA certificate is provided" do
+ let(:env) { { 'ADDITIONAL_CA_CERT_BUNDLE' => x509_certificate('wildcard.test').read } }
+
+ specify do
+ expect(subject).to match_schema
+ expect(subject.dependency_names).to match_array(['monolog/monolog'])
+ expect(subject.licenses_for('monolog/monolog')).to match_array(['MIT'])
+ end
+ end
+
+ context "when the CA certificate is NOT provided" do
+ let(:env) { {} }
+
+ specify { expect(subject).to match_schema }
+ end
+ end
+
+ context "when scanning a project with dev dependencies" do
+ before do
+ runner.mount(dir: fixture_file('php/composer/dev-dependencies'))
+ end
+
+ it 'excludes the dev dependencies' do
+ expect(subject).to match_schema
+ expect(subject.dependency_names).to match_array(['monolog/monolog'])
+ expect(subject.licenses_for('monolog/monolog')).to match_array(['MIT'])
+ end
+ end
end
diff --git a/spec/support/proxy_helper.rb b/spec/support/proxy_helper.rb
index 93805c6..9b42e18 100644
--- a/spec/support/proxy_helper.rb
+++ b/spec/support/proxy_helper.rb
@@ -7,7 +7,7 @@ module ProxyHelper
Dir.chdir License::Management.root.join('tmp') do
system([
"rm -f #{host}.*",
- "/usr/bin/openssl req -x509 -newkey rsa:4096 -keyout #{host}.key -out #{host}.crt -days 999 -nodes -subj '/C=/ST=/L=/O=/OU=/CN=*.test' -addext 'subjectAltName=DNS:nuget.test,DNS:rubygems.test,DNS:goproxy.test,DNS:maven.test,DNS:pypi.test,DNS:npm.test'",
+ "/usr/bin/openssl req -x509 -newkey rsa:4096 -keyout #{host}.key -out #{host}.crt -days 999 -nodes -subj '/C=/ST=/L=/O=/OU=/CN=*.test' -addext 'subjectAltName=DNS:nuget.test,DNS:rubygems.test,DNS:goproxy.test,DNS:maven.test,DNS:pypi.test,DNS:npm.test,DNS:composer.test'",
"cat #{host}.* > #{host}.pem"
].join("&&"))
end